• User

    Tradurre da AS3 a AS2

    Buongiorno,
    Personalizzando MODERN PHOTO SLIDESHOW template di flash cs3 mi serviva aggiungere l'opzione SALVA IMMAGINE (clicco tasto destra).
    Ho trovato il codice giusto in as3, (per aggiungere al codice già esistente) ma non funzionava sul template, dopo mi sono accorta che il template è in as2!!
    Qualcuno mi può aiutare a tradurre questo as3 in as2 per favore?
    Il codice in as3:
    stop();
    //create a new right click menu
    var saveAs:ContextMenu = new ContextMenu();
    //hide the default options
    saveAs.hideBuiltInItems();
    //create a new right click option
    var menuItemOne:ContextMenuItem = new ContextMenuItem("Save As");
    //add the option to your right click menu
    saveAs.customItems.push(menuItemOne);
    //associate the new right click contextMenu with the blue picture.
    blue_mc.contextMenu = saveAs;
    //what happens when saveAs is selected - call the downLoadPic function
    menuItemOne.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, downLoadPic);

    //fileReference is used to download file - also used for uploading
    var downLoader:FileReference = new FileReference();
    function downLoadPic(e:ContextMenuEvent):void {

    //the second argument "blue.jpg" just gives the file a different name in the save as box - its optional
    //the urlRequest is the link to the image on your server.
    downLoader.download(new URLRequest(":// localhost/ downloader/abdin.jpg"), "blue.jpg");

    }