Answer Posted / kunal
Differences between _root and _level0
At first glance it may seem that _root and _level0 refer to
the same thing. However, they are not identical.
The property _root refers to the main timeline of the movie
from which the property was referenced, or the top-most
timeline within the current hierarchy of timelines. If an
instance of the Flash Player has multiple levels, the main
or root timeline is on the level containing the currently
executing script.
The property _level0 references the main timeline of the
movie loaded into level 0. This property can be referenced
from any level and still reference the same timeline, that
on level 0.
When a SWF file is loaded into the Flash player, it's main
timeline is loaded into level 0. In this movie and this
movie only will _root and _level0 reference the same
timeline. Additional SWF files can be loaded into
additional levels using loadMovie or loadMovieNum.
References of _root in those files then reference the level
in which that SWF referencing _root was loaded. For
example, if a SWF is loaded into level 2, a reference to
_root in that SWF will reference the same timeline that
_level2 references, but will not reference the same
timeline as _level0. A reference to _root will only equal
_level0 in the SWF that was first loaded into the player
(level 0).
If you are working with levels in ActionScript, you should
always use _root to reference the main timeline in your
movies. Using _level0 may incorrectly reference the main
timeline of another SWF, the first movie loaded into the
player.
Note: ActionScript 3 no longer uses the concept of levels.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
psd. Which format would give you the most options within your flash project? : Adobe flash
what is the best reason for using the geturl command, instead of the fscommand, when communicating with the host application? : Adobe flash
you understand from the sb-25 manual that the built-in, retractable bounce card is meant for use with the flash head in a vertical position? : Adobe flash
How to write a program to show the external actionscript?
at which point can you start usability testing? : Adobe flash
Name the as3 components?
what is the most important factor in determining the compatibility of your application? : Adobe flash
for methods within objects,what does the keyword this specifically refer to? : Adobe flash
you have a textfield selected on stage and would like to separate each letter into its own textfield. Which option under the modify menu allows you to do this? : Adobe flash
Write a program to create custom list in actionscript?
Tell me what are the functions used with flash media?
you have a dynamically loaded image that is larger than your stage. Which component would work best to accommodate this image? : Adobe flash
which two textfield events can be captured to trigger scripts to run? : Adobe flash
what happens if an .swf is loaded into a already occupied level? : Adobe flash
which actionscript classes are used to play flv formatted video? : Adobe flash