Solved

how to target the original root from a loaded movie

Posted on 2006-11-13
3
188 Views
Last Modified: 2008-02-01
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!
0
Comment
Question by:sousflai
3 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17935353
if you use "this.lockroot=true" in any swf or in any movieClip, it means, that SWF or movieClip and all its child movieClips are refering it as "_root". "_root" has been locked for them, they can't go beyond that 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", 2);

//check for loading completion
this.onEnterFrame = function()
{
   if(_level2.getBytesTotal()==_level2.getBytesLoaded() && _level2._width>0){
     _level2.mainroot = this;
     delete this.onEnterFrame;
   }
}

----------------

now you can access parent "_root" inside child SWF using "_root.mainroot"

-Aneesh
0
 
LVL 5

Accepted Solution

by:
blockage1 earned 500 total points
ID: 17969550
Can't you simply target the original swf as  _level0? i.e.

_level0.gotoAndPlay(2);
0
 
LVL 12

Expert Comment

by:SamuelRostol
ID: 18179186
blockage1 is correct.

If you use _level0, you'll target the topmost level :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question