Actionscript 3.0到Actionscript 2.0

Tia*_*tro -5 flash actionscript actionscript-2 actionscript-3

我需要将这段代码降级为Actionscript 2.0.我不是Flash方面的专家.有帮助吗?

function resizeHandler(e:Event):void {
    g1_mc.x = 0;
    g1_mc.y = 0;
    g1_mc.height = stage.stageHeight;
    g1_mc.width = (stage.stageWidth - 550) / 2;
    g2_mc.width = (stage.stageWidth - 550) / 2;
    g2_mc.x = stage.stageWidth - g2_mc.width;
    g2_mc.y = 0;
    g2_mc.height = stage.stageHeight;
    bigPic.height = 800;
    bigPic.x = 0;
    bigPic.y = 0;
    activator.width = 500;
    activator.height = 200;
    activator.x = (stage.stageWidth / 2) - (activator.width / 2);
}

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler);

stage.dispatchEvent(new Event(Event.RESIZE));

// Set variables for numbers we need in our equations
var activatorWidth:int = activator.width;
var activatorHeight:int = activator.height;
var boundX:int = bigPic.x + activator.x * 2;
var diffX:int = bigPic.width - activatorWidth;
var easeSpeed:int = 7;

// Function that activates the movement (MOUSE_OVER activator)
function activate(event:Event):void {
    var divX:Number = mouseX / activatorWidth;
    var moveX:Number = divX * diffX;
    bigPic.x += (boundX - moveX - bigPic.x) / easeSpeed;
    trace("Largura do Activator ,activatorWidth,: ", activatorWidth);
    trace("Limite ,boundX,: ", boundX);
    trace("divX: ", divX);
    trace("diffX :", diffX);
    trace("moveX: ", moveX);
    trace("bigPic.x: ", bigPic.x);
    trace("boundX - moveX - bigPic.x ,X posição do bigPic,: ", boundX - moveX - bigPic.x);
    trace("boundX - moveX - bigPic.x ,X posição do bigPic,: ", (boundX - moveX - bigPic.x) / easeSpeed);
}
// Listeners on the activator to Add / Remove Enter Frame Events
activator.addEventListener(MouseEvent.MOUSE_OVER, addEnterFrameEvent);
activator.addEventListener(MouseEvent.MOUSE_OUT, removeEnterFrameEvent);
// Add Enter Frame Event Function
function addEnterFrameEvent (event:MouseEvent):void {
    addEventListener(Event.ENTER_FRAME, activate);
}
// Remove Enter Frame Event Function
function removeEnterFrameEvent (event:MouseEvent):void {
    removeEventListener(Event.ENTER_FRAME, activate);
}
Run Code Online (Sandbox Code Playgroud)

最好的祝福!

Jev*_*jev 6

以下是从AS2到AS3的迁移信息.你可以在那里找到基本信息.

希望这将是一个很好的起点.