Copy link to clipboard
Copied
I have imported a SWF into my flash project but when I play the swf file it works but when I go to another scene, the swf file stays on the other scenes. This only happens when I open the scene which the swf file is in. I am using the following Actionscript to load the swf.
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("Simulator2.swf");
myLoader.load(url);
addChild(myLoader);
myLoader.x = 185;
myLoader.y = 35;
Could anyone help? thanks!
When you load content dynamically it does not have a home in the timeline unless you plant it into something that you have manually placed there. If you create a blank MovieClip in the scene/frame where you want this file to appear, then you can add the loader as a child of that MovieClip so that it has something to anchor it to the timeline.... as in...
blankMCName.addChild(myLoader);
instead of
addChild(myLoader);
Copy link to clipboard
Copied
When you load content dynamically it does not have a home in the timeline unless you plant it into something that you have manually placed there. If you create a blank MovieClip in the scene/frame where you want this file to appear, then you can add the loader as a child of that MovieClip so that it has something to anchor it to the timeline.... as in...
blankMCName.addChild(myLoader);
instead of
addChild(myLoader);
Copy link to clipboard
Copied
Thank you, got it working.
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now