Load | difference |
1, the library has a MC, named "Ball" and connected to the first frame export. The library also has an empty MC named cont; Drag the Cont of the empty MC into the scene, take the case name Cont, and write it on the hardwood:
For (i=0 i<10; i++) {
_root.cont.attachmovie ("Ball", "ball" +i, I);
_root.cont["Ball" +i]._x = 50+40*i;
_root.cont["Ball" +i]._y = 200;
}
2, write directly on the stage on a certain MC
Onclipevent (load) {
For (i=0 i<10; i++) {
This.attachmovie ("Ball", "ball" +i, I);
this["Ball" +i]._x = 50+40*i;
this["Ball" +i]._y = 200;
}
3, write on the frame directly loaded
For (i=0 i<10; i++) {
This.attachmovie ("Ball", "ball" +i, I);
this["Ball" +i]._x = 50+40*i;
this["Ball" +i]._y = 200;
}
4, create an empty MC to load
_root.createemptymovieclip ("Kong", 1);
For (i=0 i<10; i++) {
_root.kong.attachmovie ("Ball", "ball" +i, I);
_root.kong["Ball" +i]._x = 50+40*i;
_root.kong["Ball" +i]._y = 200;
}
5. Customize a function to load
function Bal () {
For (i=0 i<10; i++) {
This.attachmovie ("Ball", "ball" +i, I);
this["Ball" +i]._x = 50+40*i;
this["Ball" +i]._y = 200;
}
}
Bal ();
6, the Library of a series of pictures loaded into the scene in the scene
On (release) {
_root.zhuye._visible = 0;
For (n=0 n<6; n++) {
This.attachmovie ("Picture", "Picture" +n, n+1);
this["Picture" +n].gotoandstop (n+1);
this["Picture" +n]._x = 100+150* (N-math.floor (N/3) *3);
this["Picture" +n]._y = 100+150*math.floor (N/3);
}
}