Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problems with imported SWF

New Here ,
Mar 24, 2013 Mar 24, 2013

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!

TOPICS
ActionScript
487
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 24, 2013 Mar 24, 2013

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); 

Translate
LEGEND ,
Mar 24, 2013 Mar 24, 2013

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); 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2013 Mar 24, 2013

Thank you, got it working.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 24, 2013 Mar 24, 2013
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines