简体   繁体   English

ActionScript 3.0无法加载SWF文件

[英]ActionScript 3.0 can't load SWF file

I have a problem about loading a SWF file(the SWF with a Main.as) 我有一个关于加载SWF文件的问题(带有Main.as的SWF文件)

Here is my code: 这是我的代码:

bt1.addEventListener(MouseEvent.CLICK, f1);

var myloader:Loader = new Loader();
var myURL:URLRequest = new URLRequest("test.swf");

myloader.load(myURL); 

function f1(Event:MouseEvent):void
{
   addChild(myloader);

   myloader.x=100;
   myloader.y=200;
   myloader.width =200;
   myloader.height =60;    
} 

When I clicked load button, I can hear the sounds(test.swf), but I cant see anything. 单击加载按钮时,我可以听到声音(test.swf),但看不到任何声音。

您是否尝试使用stage.addChild(myloader);?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM