difference between _root and _level

Answers were Sorted based on User's Feedback



difference between _root and _level..

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

difference between _root and _level..

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

difference between _root and _level..

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

difference between _root and _level..

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

difference between _root and _level..

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

difference between _root and _level..

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

difference between _root and _level..

Answer / hari

They are same, which denotes the parent stage

Is This Answer Correct ?    7 Yes 21 No

Post New Answer

More Flash Action Scripting Interview Questions

What are the different primitive data types used in actionscript?

0 Answers  


which is an advantage of selecting a flash player version in publish settings before beginning a project? : Adobe flash

0 Answers  


Do you know what are the different primitive data types used in actionscript?

0 Answers  


what is the advantage of progressive video download? : Adobe flash

0 Answers  


What are the changes presented by actionscript?

0 Answers  






How to download Flash object embeded in HTML Page?

3 Answers   Siber, US Software Corporation,


How to Communicate with JavaScript?

5 Answers  


What are the features involved in updating a language?

0 Answers  


the class that is inheriting the another is known as the? : Adobe flash

0 Answers  


Write a program that shows the usage of data types?

0 Answers  


Give an example that illustrates polymorphism in flash script.

0 Answers  


Explain what are the differences between javascript and actionscript?

0 Answers  


Categories