as3.0加载外部swf 获取里面的变量

2025-02-02 15:04:29
推荐回答(2个)
回答1:

赞同楼上意见

回答2:

a.swf文件的代码:
var ccc:uint = 15;
另一个swf文件的代码:
var ab:Loader = new Loader();
ab.x = ab.y = 200;
ab.load(new URLRequest("a.swf"));
addChild(ab);
ab.contentLoaderInfo.addEventListener(Event.COMPLETE,zai);
function zai(evt:Event):void
{
var loadswf = evt.target.content;
trace(loadswf.ccc);
}