AS2 .swf loadmovie() and unloadmovie() fail when nested inside an AS3 .swf container

▼魔方 西西 提交于 2019-12-13 15:26:45

问题


I have an AS2 .swf being loaded as a child of a parent AS3 .swf. The AS2.swf calls loadmovie() and unloadmovie() to display 3 jpeg files. The images load the first time, but after that, a call to loadmovie() to replace the image, or a call to unloadmovie() fail. I found the following Adobe Bug report (https://bugs.adobe.com/jira/browse/ASC-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel) that has said this has been resolved, and also said that child movieclips could be replaced without a problem. Here is the code I'm calling.

_root.help_mc.scenes_image1_mc.loadMovie("first.jpg");
_root.help_mc.scenes_image2_mc.loadMovie("second.jpg");
_root.help_mc.scenes_image3_mc.loadMovie("third.jpg");

_root.help_mc.scenes_image1_mc.unloadMovie();
_root.help_mc.scenes_image2_mc.unloadMovie();
_root.help_mc.scenes_image3_mc.unloadMovie();

I'm not well versed in ActionScript, so I'm afraid I might not be referencing the movieclip in the correct way. The bug report said child swf's cannot replace themseleves, but if the AS2 swf is acting as the psuedo root, can I reference the movieclip through the AS2 swf?


回答1:


AS2 doesn't work along-side AS3. Flash Player 9 and above have two different virtual machines - one for AS1, AS2 and the other for AS3 and only one of them is loaded at once, meaning that you can execute either AS3 or AS2 but not both.

http://en.wikipedia.org/wiki/ActionScript#Timeline_by_ActionScript_version




回答2:


In ActionScript 3 you load a movie like this:

var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("first.jpg");
myLoader.load(url);
addChild(myLoader);


来源:https://stackoverflow.com/questions/1044713/as2-swf-loadmovie-and-unloadmovie-fail-when-nested-inside-an-as3-swf-conta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!