• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Lock the Root

Let’s say you have a movie called Main.fla, which loads several Flash movies (SWF files) into it while it runs using the loadMovie command. One of these files is Footer.swf, and in Footer.swf you have a lot of code that refers to _root. If you run Footer.swf on its own, the code will run fine because _root refers to the main Timeline of Footer.swf. However, once you’ve loaded Footer.swf into Main.swf, _root will point to the Main.swf Timeline.

There are many of you that have had to deal with this little quirk over and over. With Flash MX 2004, there is a new Boolean variable called _lockroot that corrects this issue. Place the following code in the Footer.fla main Timeline:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint