all groups > flash actionscript > july 2007 >
You're in the

flash actionscript

group:

loading an external swf into my parent swf?



loading an external swf into my parent swf? Petebts
7/20/2007 8:42:43 PM
flash actionscript: Does anyone know how I can load an external .swf file into my parent file? I
have tried to use loader actionscript but think I am using the incorrect script
or putting it in the wrong place? If anyone can tell me the script and where
to/how to use it that would be amazing? Thanks :grin;
Re: loading an external swf into my parent swf? Petebts
7/20/2007 10:34:10 PM
Ok so i have finally figured it out, and another problem has arisen!! i've
used the stop command to allow the external movie to load. now when it unloads
it wont run the original movie as there is a stop command, is there a way when
it unloads and goes back to the parent swf that i can bypass the stop action
and tell it to go elsewhere in the parent swf??
Re: loading an external swf into my parent swf? GWD
7/20/2007 10:44:59 PM
How are you unloading/removing it?

E.g. did you put some something like:
this.removeMovieClip();

in the last frame of the child swf etc?

If so and if you loaded it as a child of the other swf that you used the
stop() command in, then just before you issue the this.removeMovieClip() code,
you could put

_parent.play();

or _level0.play();

I think that should work.
Re: loading an external swf into my parent swf? Petebts
7/21/2007 1:59:31 PM
thanks GWD!
I am using the unloadMovieNum(); command, i have loaded the child into level 5
of my parent swf. the parent has multiple scenes this one with a layer with a
stop(); action and another layer with the loadMovieNum("portfolioone.swf", 5);
script. it loads the child perfectly. The child has a number of pictures in it
and a back button at the end. I have been adding the

on (release) {
unloadMovieNum(5);
}
script to the button which unloads the child but stops because of the stop
action in the first frame of the particular scene within the parent. I want to
be able to add a script to this button which will take me back to a labeled
frame in a particular scene of the parent, I tried the this.removeMovieClip();
but doesn't seem to be working for me, Thanks for the reply, hope you can help
me further??

Re: loading an external swf into my parent swf? GWD
7/21/2007 2:15:21 PM
Is the "parent" on level0? if so try changing the button code to :

on (release) {
_level0.play();
unloadMovieNum(5);

}


Re: loading an external swf into my parent swf? Petebts
7/21/2007 2:22:08 PM
Perfect, works a treat! it takes me back to the next scene in the parent .swf,
one last thing, sorry, is there a way to have it take me back to a scene and
frame of my choice? Your help is massively appreciated!

Re: loading an external swf into my parent swf? GWD
7/21/2007 2:27:18 PM
You can use (replace the frame_number_here with the frame number):

_level0.gotoAndPlay(frame_number_here);

for scenes I'm not so sure... I don't use them sorry.

Perhaps it might work :

_level0.gotoAndPlay("scene_name_here",frame_number_here);


Re: loading an external swf into my parent swf? Petebts
7/21/2007 2:43:54 PM
Thank you so much GWD! great help!! i was able to use the gotoandplay script to send it to a labelled frame in a different scene, didn't need to use the scene name!!

Thanks again!

Re: loading an external swf into my parent swf? GWD
7/21/2007 3:39:27 PM
AddThis Social Bookmark Button