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 on the stage named my_ Example of mc
_ Root. gotoAndPlay (10) means that the main timeline jumps to frame 10 for playback
2. When using loadmovie to load external swf files_ The root points to the stage of the main swf or the main timeline of the main swf file
_ Root represents the main timeline. This is a top-level instance name, which can also be said to be fixed. For example, in the main scene, there is a movie clip named toy_ Func, you can use the following code to control the playback of this abc_ root.toyean_ Func. play() This is actually a_ Func indicates the path.
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_ Root is understood as the main timeline of the movie. Any movie clips are placed on this main timeline. The AS syntax expression is_ Root.mc1 and_ root.mc2。 Here we assume that there is film 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, which are:_ root.mc1.mc3._ x;
_ root.mc1.mc3._ y; If you want to hide mc1, you can write:_ root.mc1._ visible=0;
The whole movie can be seen as_ level0。 Then we can understand it as_ Level0 and_ The effect of root is the same, but there are conceptual differences between the two.
_ 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, then_ 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)
trace(a);// Tracking a;