• User Newbie

    problema con Action Script

    Ciao a tutti, ho un problema,vorrei inserire la funzione zoom per questo runtime di un pageflip,

    var initObj = new Object();
    initObj.extXML = _level0.xmlConfig;
    initObj._x = 275;
    initObj._y = 200;
    _root.attachMovie("FFlippingBookSymbol", "myBook", 0, initObj);
    myBook.onXMLComplete = function(){
    trace("XML is loaded..");
    }

    tutto funziona,ma come faccio ad implementare questo codice per lo zoom?Non ne vuole sapere di funzionare...

    import mx.containers.Window;
    // Popup size
    popup_width = 527;
    popup_height = 400;
    // Zooming settings
    zooming = false;
    zoom_panel_mc.zoom_btn.onPress = startZoomingMode;
    myBook.onClick = bookClick;
    function startZoomingMode() {
    myBook.flipOnClickProp = false;
    myBook.autoFlipProp = 0;
    showZoomPointer();
    zooming = true;
    }
    function bookClick(pageNumber, page_mc, isCornerClick) {
    if (!zooming) {
    return;
    }
    var page_url = page_mc.URL;
    if (page_url != undefined) {
    open_popup(page_url, pageNumber);
    } else {
    zooming = false;
    myBook.flipOnClickProp = true;
    myBook.autoFlipProp = 50;
    hideZoomPointer();
    }
    }
    function open_popup(page_url, pageNumber) {
    if (zoom_win != undefined) {
    return;
    }
    hideZoomPointer();
    zoom_win = mx.managers.PopUpManager.createPopUp(_root, Window, true, {title:"Page Number: " + pageNumber, closeButton:true});
    zoom_win.createObject("ScrollPane", "zoom_pane", 0, {contentPath:page_url, _x:3, _y:31});
    zoom_win.setSize(popup_width, popup_height);
    zoom_win.zoom_pane.setSize(popup_width-6, popup_height-31);
    listenerObject = new Object();
    listenerObject.click = closeWindow;
    zoom_win.addEventListener("click", listenerObject);
    zoom_win._x = Stage.width/2-popup_width/2;
    zoom_win._y = Stage.height/2-popup_height/2;
    }
    function closeWindow(eventObject:Object) {
    zoom_win.deletePopUp();
    zooming = false;
    delete zoom_win;
    myBook.flipOnClickProp = true;
    myBook.autoFlipProp = 50;
    }
    function showZoomPointer() {
    Mouse.hide();
    attachMovie("ZoomIcon", "zoom_icon_mc", 0);
    zoom_icon_mc.onEnterFrame = function() {
    this._x = _xmouse;
    this._y = _ymouse;
    };
    }
    function hideZoomPointer() {
    Mouse.show();
    delete zoom_icon_mc.onEnterFrame;
    zoom_icon_mc.removeMovieClip();
    }