Root question

Root question

Post by sneski » Sun, 31 Jul 2005 12:33:05


if I load in a flash movie that uses root in its code, will the top most movie
be the root, or will the loaded movie refer to itself as the root.

I made a large movie and it has alot of code in it that uses root all the
time. Now im thinking of making a loader movie so people with a slower
connection can see the movie load, but i need to know how it will effect the
code.

thanks
 
 
 

Root question

Post by kgla » Sun, 31 Jul 2005 12:53:06

the loaded movie will refer to its main timline as the _root timeline only if
you attach the following to its _root timeline:

this._lockroot=true;

otherwise, the main timeline in the loading movie is the _root timeline.

 
 
 

Root question

Post by sneski » Sun, 31 Jul 2005 13:22:47

just to make sure i get this

Movie A loads Movie B
if B._lockroot=true then the actionscript in Movie B will interpret _root as B
otherwise the _root will be A

can lockroot be toggled on and off at any time?
 
 
 

Root question

Post by kgla » Sun, 31 Jul 2005 13:51:08

the answer to your first quesiont is yes but to be more precise aobut it: if
swfA loads swfB into target movieclip B, then B._lockroot=true will cause all
references to _root in swfB to refer to the main timeline in swfB.

the answer to your second question is yes. B._lockroot=true can be turned off
anytime with B._lockroot=false.