difference between _root and _level
Answers were Sorted based on User's Feedback
Answer / mohammed sunely
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.
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.
| Is This Answer Correct ? | 20 Yes | 1 No |
Answer / anmol saraf
Every level has a root inside it, like _level0 has a root
timeline of its own, level1 has its own and so on..
Untechnically and in explanation point of view a root can
be said as a child of level.
We use levels whenever we need to load new swf, jpg or gif
files inside our current working swf but not in a movieclip
and need to be placed above the current elements without
replacing any.
Any swf loaded in at level0 will replace all the contents
with the new but placed in level1 with bring every new
content above the old.
So level0 refers to one root of his own and level1 refers
to another root of his own. Every level has a root and then
corresponding child movieclips and elements inside one
another.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / amjad hussain ghazi
Ok.. welll here is what the difference is:
Every SWF file runs at some unique level. Let us say we
have two swf files namely parentSWF and childSWF, with
childSWF loaded into parentSWF file.
As said, each swf runs at a unique level, assume that
parentSWF is running at level0 and childSWF is running at
level1. Therefore, if level0 will refer to the main
timeline of parentSWF and level1 will refer to the main
timeline of childSWF.
_root will always refer to the maintimeline of its own swf.
In other words, if we say _root in childSWF, it will point
to the maintimeline of childSWF. Similarly, if we say _root
in parentSWF, it will refer to the maintimeline of
parentSWF.
It is therefore important to note that _root and level0
will only be same if they are being referenced from the swf
file that is running at level0. Similarly, _root and leveln
will be same only in the swf that is running at leveln.
As per the above explanation, if you refer to _root and
level0 in an swf file that is running at leve5, the _root
will point to the maintimeline of this particular swf
(running at level 5) and level0 will point to another swf
that is running at level 0.
Hope that helps :)
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / 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 |
Answer / karthikeyan
_root is the main movie clip on flash
but vritualy multiple _level holds multiple _root
eg:
_level0._root.mc_1
and
_level0.mc_1
refers one object
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / dinesh anand
_root:It reffers to the stage
_level:It reffers to current level of the swf.We have to
mention the level in "loadMovieNum" function.
| Is This Answer Correct ? | 0 Yes | 1 No |
at which point can you start usability testing? : Adobe flash
what are the properties can be used to control the order in which the user can tab through the elements in a flash movie? : Adobe flash
which of the methods provedes the most controlled printing of flash content? : Adobe flash
How to play a movie clip?
Can you explain what does the void function and object contain in actionscript?
What are the different primitive data types used in actionscript?
What does reference means in actionscript?
which two textfield events can be captured to trigger scripts to run? : Adobe flash
if we set slow sync as you suggest in answers on the many online forums you visit, would not we be opening ourselves up to blurred shots when the shutter speed gets significantly below 1/60? : Adobe flash
How to write a program use a text field and display it using the actionscript?
Do you know what are the ways in which actionscript's code can be protected?
how does an xmlsocket server know when a received message is complete? : Adobe flash