I have a swf file which i have imported into another by adding it to the library and then giving it a linkage class to be imported at runtime.
The child swf file contains code to stop it’s timeline at frame 1, then wait for a given amount of time, and then carry on. This works fine when run stand alone, however when run from within the parent, it just loops, disregarding the stop() function at frame 1.
Any ideas why this is ?
The code im using to stop the child swf is simply
this.stop();
And the code im using to import the child swf at runtime (within the parent one) is
var childSwf:Child = new Child();
addChild(childSwf);
Any help would be greatly appreciated.
Have you tried loading the SWF using URLRequest()? This is the method I have always used, and have never come across this sort of problem.
Look it up in here: http://www.iheartactionscript.com/loading-an-external-swf-in-as3/
Hope it works ![]()
Harry.
- 04 August 2008 01:01 PM
-
If it works fine when run on its own and breaks when loaded into parent then it sounds like a scope problem. Have you tried dropping ‘this.’ and just use ‘stop();’ on frame 1 of the child swf?
- 05 August 2008 11:20 AM
-
Hey D, you can in fact make as many instances as you want.
lets say you have finished loading your swf into a loader call movieLoader. Don’t add movieLoader as a child in stead do this.
var clip1:MoiveClip = movieLoader.content;
var clip2:MoiveClip = movieLoader.content;
var clip3:MoiveClip = movieLoader.content;
var clip4:MoiveClip = movieLoader.content;
var clip5:MoiveClip = movieLoader.content;
addChild(clip1);
addChild(clip2);
addChild(clip3);
addChild(clip4);
addChild(clip4);
if you are doing it dynamically use an array to store the refrences to the clips, and there you go, multiple instances of a loaded swf.
- 05 August 2008 11:28 AM
-
- Log in or join for free to make a comment.


