Flash / AS3:加载外部 swf *带动画*
我将三个外部 swf 文件加载到我的 Flash 影片中,代码如下:
import flash.display.*
var screens:Array = new Array(
'screens/left.swf',
'screens/center.swf',
'screens/right.swf'
);
var loaders:Array = new Array();
function complete_listener(event:Event):void {
event.target.content.width = 341;
event.target.content.scaleY = event.target.content.scaleX;
}
for (var i=0; i<screens.length; i++) {
loaders[i] = new Loader();
loaders[i].contentLoaderInfo.addEventListener(Event.COMPLETE, complete_listener);
var url:URLRequest = new URLRequest(screens[i]);
loaders[i].load(url);
loaders[i].x = 341 * i;
loaders[i].y = 0;
addChild(loaders[i]);
}
我的三个虚拟 swf 一切正常,但是当我尝试加载使用某种动画(例如补间动画)的 swf 文件时,swf不再显示...有办法解决这个问题吗?谢谢你!
i load three external swf files into my flash movie, here's the code:
import flash.display.*
var screens:Array = new Array(
'screens/left.swf',
'screens/center.swf',
'screens/right.swf'
);
var loaders:Array = new Array();
function complete_listener(event:Event):void {
event.target.content.width = 341;
event.target.content.scaleY = event.target.content.scaleX;
}
for (var i=0; i<screens.length; i++) {
loaders[i] = new Loader();
loaders[i].contentLoaderInfo.addEventListener(Event.COMPLETE, complete_listener);
var url:URLRequest = new URLRequest(screens[i]);
loaders[i].load(url);
loaders[i].x = 341 * i;
loaders[i].y = 0;
addChild(loaders[i]);
}
everything works just fine with my three dummy swf's, but when i try to load an swf file that uses some kind of animation (for example a motion tween), the swf isn't displayed any more... is there a way around this? thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我无法正确理解您的问题..但我建议您将
stop()
放在您要加载的所有三个 swf 上。然后当它们加载后,您就可以开始动画了。试试这个...
Well I can not understand your problem properly.. But I will advise you one think that put
stop()
on all three swfs which you are gonna load. Then when they are loaded, you can start your animation then.Try this...