简体   繁体   English

将AS2 SWF加载到AS3 SWF中时会发生奇怪的行为,有人对此有何解释?

[英]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. ActionScript-3文档说: 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.

相关问题 AS2 SWF是独立运行的,但是当包含在AS3 SWF中(即使仅加载时),它的行为也很奇怪,有什么想法吗? - AS2 SWF works standalone, but when included into AS3 SWF (even when ONLY it is loaded) it acts strangely, any ideas? 将外部PNG加载到AS2 SWF包装器中的AS2 SWF中 - Loading external pngs into an AS2 swf that is loaded into an AS3 swf wrapper 承载AS2 SWF的AS3 SWF如何共享同一阵列? - How can an AS3 swf hosting an AS2 swf share the same array? 调整加载的 swf AS2 - Resize loaded swf AS2 在AS3中控制AS2 SWF播放 - Controlling as2 swf playback in as3 为什么在运行Safari和Mozilla的Mac上使用SWFBridge将AS2 SWF停止加载到AS3 SWF中? - Why would my AS2 swf stop loading into AS3 swf with SWFBridge on Mac running safari and mozilla? 当嵌套在AS3 .swf容器中时,AS2 .swf loadmovie()和unloadmovie()失败 - AS2 .swf loadmovie() and unloadmovie() fail when nested inside an AS3 .swf container 将SWF加载到另一个中时。 主SWF能否读取已加载的SWF文件以检索其内容并进行修改? - When a SWF is loaded into another. Can the main SWF read the loaded one to retrieve its contents and modify them? AS3从已加载的SWF自身中卸载SWF - AS3 unloading SWF from loaded SWF itself 将符号从AS2 SWF加载到AS3应用程序中? - Loading symbols from an AS2 SWF into an AS3 application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM