How to display as2 swf file within as3 swf?
I recently found out that the flash swf's I was trying to load were in as2 which is causing a great deal of problems. The sad reality is I need to load these up somehow, or find some alter开发者_开发知识库native.
What are my options for loading as2 into as3 from a remote source (different domain). I'm using Flashbuilder 4.5 as my development tool. I've been using flex for about two weeks now, so this is a little daunting...
Thanks
The flash player has two different virtual machines for playing AS2 and AS3 content, but they can both work at once - in general, AS2 movies should play normally even when loaded into an AS3 parent.
So the answer to your question is, loading AS2 into AS3 isn't your problem, and you'll need to find out what is. Perhaps you're loading in the child but not adding it to the stage, or perhaps the child movie is made such that it waits for a function call before displaying anything? Those are just random guesses, all I can say confidently is that you have a bug somewhere you're not aware of.
Use a SWFLoader?
More docs here.
This came up recently, see here: Load AS2 SWF Into AS3 SWF and pass vars in URL
heres the code:" im sick of people just giving worthless inputs to problems, i think or maybe's or here is a link to go somewhere else bla bla bla (SOLVED)!
var swfLoader:Loader = new Loader();
stage.addChild(swfLoader);
var whatEver:URLRequest = new URLRequest("your_AS2_AS3.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
swfLoader.load(whatEver);
function loadComplete(e:Event):void {
trace("file loaded");
}
I have used this many of times with no problems,please note when you load an out side SWF file, That movies frame rate is the same as the parent Movie/Main movies frame rate. For detailed info on this class check adobe website Docs.
精彩评论