Usage of _root in Flash

web front end fourteen thousand two hundred and ninety-four 14 years ago (2011-12-19)

1. No matter where the _root is written, it always points to the main scene or the main timeline
For example, _root.my_mc refers to the instance named my_mc on the stage
_Root. gotoAndPlay (10) means that the main timeline jumps to frame 10 for playback

2. When using loadmovie to load an external swf file, the _root of the external swf file points to the stage of the main swf or the main timeline of the main swf file

_Root represents the main timeline. This is the top instance name, which can also be said to be fixed. For example, in the main scene, there is a movie clip named toyean_func. To control the playback of this abc, you can use the following code _root. toyean_func. play(), which is actually used when representing the path to toyean_func.

About _root:
Create a new file, and a stage will appear on the screen. This is _root. Suppose we add film clips to the stage, for example, we add mc1 and mc2 to the stage.
We can understand _root as the main timeline of the movie. Any movie clip will be placed on this main timeline. The AS syntax expression is _root.mc1 and _root.mc2. Here we assume that there is a movie clip mc3 in mc1, which is _root.mc1.mc3.
Here we should remember such a rule: from large to small, from outside to inside, from the outermost to the largest, we can know the attributes or variables of film editing by making film editing in point syntax.
For example, we need to know the x and y coordinates of mc3, that is, _root.mc1.mc3.x;
_root.mc1.mc3._y; If you want to hide mc1, you can write: _root. mc1. _visible=0;

About _level
The whole movie can be regarded as _level0. So we can understand here that the effects of _level0 and _root are the same, but they are different in concept.
About _global
_Global is from FLASH The concept introduced by MX is only supported by flash player 6 or above. It is a global variable, that is, if a variable, function or object is declared as _global, it can be called in _root or movie clip. For example, we define a global variable a and assign it a value of 500; _global.a=500; For example, we click the button in the main scene to change a from 500 to 100; Add the following code to the button: on (release)
{
a=100;
trace(a); //Tracking a;
}