Search code examples
flashactionscript-3actionscript-2integrationflash-cs3

Strange Behavior of AS2 swf breaking when loaded into AS3 swf can any one explain as to why this is?


The ide i am using is flash cs3. the as2 swf contains a tween code using mx transitions. when i remove this tween code and hard code it on the enterframe there seems to be no problem. afaik avm2 should fully supports the as2 and as1 code. so i am unable to understand why this disparity when coding a simple tween in as2 swf. i had made a post in the actionscript forums hoping to gain some light on the issue. with a very simple attachment illustrating the issue http://www.actionscript.org/forums/showthread.php3?t=229901 p.s the 2 swf do not interact with each other. the code in as2 file

//~~~~~~~~~~~~~~~~~~~~~~~ with tween class
import mx.transitions.*;
import mx.transitions.easing.*;

function tweenMe(mc, target) {
myTween = new Tween(mc, "_x", Regular.easeOut, mc._x, target, 2, true);
}
tweenMe(mc, 700);

//~~~~~~~~~~~~~~~~~~~~~~~ Simple Hard coded control

/*this.onEnterFrame = function() {
    mc._x += (700-mc._x)/10;
};
*/

Solution

  • the only convincing answer i had come across regarding this problem was this

    http://www.actionscript.org/forums/showpost.php3?p=968206&postcount=9

    depending upon situation it might be easier to just re-code the trouble code bit.