This content has been marked as final. Show 5 replies
> is there a definitive forum-post or article or whatever, about:
> understanding _root and _level0 and _levelN?
There is now...
There are any number of levels in the flash player, that by default are
layered/stacks so that level 0 is behind level 1, which is behind level 2
The first SWF movie you load goes into level 0 automatically. You can load
other SWF's into other levels.
_levelN refers to the root of the SWF movie loaded into level N.
_root refers to the root of the SWF for the current level (ie the level that
owns the object that owns the script that is currently executing)
Its really not that hard ... have you read the help?
> for example: if a given SWF can loadMovie() another SWF into "level17",
> can that 'child' movieclip say "_parent._root"
Its not a child movie clip then .. its a separate movie (not clip) playing
in another level. It doesn't have a _parent
> okay, then what if you have some wierd superFlash contraption that deeply
> loads SWFs so that nothing can be sure
> it is really the "main zero top root" timeline of anything??
If you load into a level, it cannot be nested .. levels are a simple linear
'stack' of movies, there is no nesting there.
You can load a SWF into a movieclip (INSTEAD of into a level) .. then you
can get nesting.
> what kind of
> code is necessary to climb all over the currently
> and know what the whole monster looks like (and facilitate communication
> between them)?
_parent goes to immediate parent
_root goes to highest level parent or parent or parent for the movie (the
_levelN goes to the _root for a given level number N
> i'm not a programmer, but it sure seems that nothing but Flash has _levels
> movieclips and timelines...
> and so there is no Java or C++ or Scheme paradigm or model for what is
> on in Flash...
Its very much like levels = hard disks, _root is root (top level) folder on
the disk, _parent is the '..' link to parent folder
Anyone whoe programs anything more than very trivial will have similar
structures of parents and children. Its got to be one of the most basic and
useful paradigms in programming.
> thus, there is indeed something quite special about being a Flash
> something not quite here yet.
Not really .. you jsut have to 'get it'.
thank you Jeckyl
that did do it.
1. every _levelN has its own _root
2. _level0 is the _root of the main SWF that loaded first
3. the _levelN are a simple linear 'stacking' structure
> _root refers to the root of the SWF for the current level (ie the level that
> owns the object that owns the script that is currently executing)
> _root goes to highest level parent or parent or parent for the movie (the
> root timeline)
> _levelN goes to the _root for a given level number N
> thank you Jeckyl
Glad to help
great, so now i find....... _LOCKROOT
public _lockroot : Boolean
A Boolean value that specifies what _root refers to when a SWF file is loaded into a movie clip. The _lockroot property is undefined by default. You can set this property within the SWF file that is being loaded or in the handler that is loading the movie clip.
> great, so now i find....... _LOCKROOT
Yes .. that determines what _root means within a loaded SWF (when it is
loaded into another movie) .. does _root refer to the _root of the main
timeline of the level it is loaded into (at some nested place) .. OR does
_root refer to the _root of the main timeline of the SWF that was loaded (as
it is when the SWF is played on its own).