[英]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. 我正在使用的IDE是Flash CS3。 the as2 swf contains a tween code using mx transitions.
as2 swf包含使用mx过渡的补间代码。 when i remove this tween code and hard code it on the enterframe there seems to be no problem.
当我删除此补间代码和硬代码在enterframe上似乎没有问题。 afaik avm2 should fully supports the as2 and as1 code.
afaik avm2应该完全支持as2和as1代码。 so i am unable to understand why this disparity when coding a simple tween in as2 swf.
所以我无法理解为什么在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 ps the 2 swf do not interact with each other.
一个非常简单的附件说明了这个问题http://www.actionscript.org/forums/showthread.php3?t=229901 ps 2 swf不会互相影响。 the code in as2 file
as2文件中的代码
//~~~~~~~~~~~~~~~~~~~~~~~ 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;
};
*/
I don't think you can use _x
while using AS3 Tween
Class. 我认为使用AS3
Tween
类时不能使用_x
。 Your Actionscript-2 swf will be treated as AVM1Movie
object (descendants of DisplayObject
). 您的Actionscript-2 swf将被视为
AVM1Movie
对象( DisplayObject
后代)。 And in ActionScript-3, DisplayObject
doesn't have property _x
. 在ActionScript-3中,
DisplayObject
没有属性_x
。 So Try using: 因此,尝试使用:
function tweenMe(mc, target) {
myTween = new Tween(mc, "x", Regular.easeOut, mc.x, target, 2, true);
}
tweenMe(mc, 700);
ActionScript-3 Documentation says this: The AVM1Movie object can use methods and properties inherited from the DisplayObject class (such as x, y, width, and so on). However, no interoperability (such as calling methods or using parameters) between the AVM1Movie object and AVM2 objects is allowed.
The AVM1Movie object can use methods and properties inherited from the DisplayObject class (such as x, y, width, and so on). However, no interoperability (such as calling methods or using parameters) between the AVM1Movie object and AVM2 objects is allowed.
The AVM1Movie object can use methods and properties inherited from the DisplayObject class (such as x, y, width, and so on). However, no interoperability (such as calling methods or using parameters) between the AVM1Movie object and AVM2 objects is allowed.
the only convincing answer i had come across regarding this problem was this 关于这个问题,我遇到的唯一令人信服的答案是
http://www.actionscript.org/forums/showpost.php3?p=968206&postcount=9
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. 根据情况,重新编码故障代码位可能会更容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.