From gotoandplay ... Start [Learning Objective]: Through simple examples, repeated practice Play, GotoandPlay, STOP usually, what you can add AS. In the tutorial, we know that there are specific three places to load As, that is, key, movie clips, buttons, now we truly do it through specific examples.
When we do animation, if you arrange the performance of the "actor" in order, it is only the positioning of the playback head on the time axis. The specific situation is "stopping, broadcasting, to a certain stop, to a big broadcast", or relatively, "the next, the next, the last scene, the next scene". For the positioning of these timelines, the AS has to prepare ready-made "instructions", which is the function, corresponding to the following: 1, stop (): is the playback of the current animation. 2, play (): Pause animation and continue to play. After broadcasting from the beginning. 3, gotoandplay ([Scene,] frame): When you go to [a scene], you start broadcasting again. 4, gotoandstop ([Scene], Frame): To [a scene] a temporary animation. 5, NextFrame (): Play the next frame and stop in the next frame. 6, prevframe (): Play the previous frame and stop in the previous frame. 7, NextScene (): Go to the next scene. 8, prevscene (): Enter the previous scene. It is very important to explain: 1 letter case cannot be changed, AS2 is special, case sensitive. 2 [Scene], Frame This is the condition, that is, the parameters, Scene refer to scene, can be omitted, so it is used [], and the current scene is omitted. Frame represents, there is 2 cases, one is that the specific value is digital, and the second is "label", that is the string, you must use "". After the foundation is finished, it is now practicing these functions. Animation requirement: Use the button control park and the movement. Steps: 1. Establish three elements, squares, and triangles, this is the three actors we command, of which the triangle is a rotating video clip. 2, new layer, name "round movement", insert a key to 1,49, place a circular element, and establish a sports animation. 3, new layer, name "Sports", insert key, place square components, and establish a sports animation at 50, 100 桢. 4, new layer, name "triangle", insert the key, put the triangular components in 1 桢. 5. Open the public library - button, drag 5 different buttons, put it in five new layers. Name Play, Stop, Next, Prev, Gotoplay 6, New Layer, Name "ActionScript", insert the key, add it to the script "Stop ();", the purpose is to start being stationary, wait We go to control. 7. In the layer "round movement", the 49th plus action script "STOP () '". 8, on the layer Play button, add as a script: on (release) {
Play ();
}
9, on the layer STOP button, add the script: on (release) {
STOP ();
}
10, on the layer NEXT button, add as a script: on (release) {
Nextframe ();
11, on the layer Frev button, add as a script: on (release) {
Prevframe ();
}
12, on the layer gotoplay button, add as a script: on (release) {
GotoandPlay (50);
} 13, on the layer "triangle", add action script onClipEvent (mousedown) {
STOP ();
}
Here you are not familiar with it is on (Release), understands to release the mouse button when the mouse pointer is passed through the button ..., there is ONCLIPEVENT (MouseDown), when you press the left mouse button ... ..., later we have to introduce in detail. This example is a good experience 2 point, one is the position, and the other is "instructions" of 8 positioning players. Repeatedly practicing. I understand it yourself.
Source:
http://jinjunshi.blogchina.com