sousflai
asked on
how to target the original root from a loaded movie
I've got a large project which I've had to disect into chunks.
I'm loading each swf in as a loaded movie with loadMovie("addprovider.swf ", 1);
inside the addprovider.swf is a movie clip. At the end of this movie clips timeline I would like it to target the root of the holding original swf and get it to move on a frame to simultaneously unload the movie and load in the newt in the sequence.
ive tried
this._lockroot = true; on the first frame of the main swf with _root.gotoAndPlay(2); in the loaded movie but it isnt working,
the second frame of the main swf unloads the movie with
stop();
unloadMovie(1);
loadMovie("addclient.swf", 2);
I would be very grateful for any help!
I'm loading each swf in as a loaded movie with loadMovie("addprovider.swf
inside the addprovider.swf is a movie clip. At the end of this movie clips timeline I would like it to target the root of the holding original swf and get it to move on a frame to simultaneously unload the movie and load in the newt in the sequence.
ive tried
this._lockroot = true; on the first frame of the main swf with _root.gotoAndPlay(2); in the loaded movie but it isnt working,
the second frame of the main swf unloads the movie with
stop();
unloadMovie(1);
loadMovie("addclient.swf",
I would be very grateful for any help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
blockage1 is correct.
If you use _level0, you'll target the topmost level :)
If you use _level0, you'll target the topmost level :)
1.
if you have not used "_lockroot=true" in child swfs, then you can simply access parent _root using "_root"
2.
but if you have used "_lockroot=true" in child swfs, then you can't acess parent "_root" directly..
wordaround in this scenario is, after child SWF loading you have to set a parent "_root" pointer inside child SWF.. for example:
------------
loadMovie("addclient.swf",
//check for loading completion
this.onEnterFrame = function()
{
if(_level2.getBytesTotal()
_level2.mainroot = this;
delete this.onEnterFrame;
}
}
----------------
now you can access parent "_root" inside child SWF using "_root.mainroot"
-Aneesh