Getting started with AS!

xiaoxiao2021-03-05  29

[color = maroon] [b] Preface: [/ b] [/ color] I wrote these tutorials, the purpose is to hope that Flash's enthusiasts can do more, less questions. I will below these tutorials, including the readers of Flash (MX) basic operation knowledge. While watching my tutorial, I hope I can open Flash, I do it while you look, so your impression will be more profound, and you will see if I write wrong :)

[Color = Maroon] [B] AS foundation [/ b] ---------------------------------- / color] Flash enthusiasts who have done Flash animations know that it is essential to do a flash animation, as is essential, even if it is just a very simple code, it can play the entire Flash painting dragon. Here I only briefly introduce the basic common sense of AS. First we have to know where [color = red] as is written, when AS will be triggered to execute [/ color].

[Color = Maroon] [B] 1, Frame: [/ B] [/ color] Write an AS above the key frame, when the pointer on the time axis comes to this key frame, it is written on this frame on this frame. Just being triggered. Common examples have STOP (), etc. written on the frame end of the film. The method of operation is to click on the keyframe and then open the AS panel.

[Color = Maroon] [B] 2, buttons: [/ b] [/ color] Unlike the AS above the frame, the AS above the button is to trigger conditions. To write the AS on the button, the operation method is to click the target button and open the AS panel. Even an example can say more. Suppose there is an animation, let it stop at the same time, then, what you have to do is written as [quote] stop (); [quote] stop (); [/ quote], then there is a button, the effect is Stop playback after the button, then the steps are as follows. Do a button, put it until the main scene, click the button, and open the AS panel. Now if you also write [quote] stop (); [/ quote], then you will prompt when you output it. Correct should write [quote] on ([color = red] release [/ color]) {stop ();} [/ quote] Here you can more than the frame of the frame: On (Release) {}, the entire code Translated is: [Quote] When (release) {Stop} [/ quote] Red code indicates one of the triggered events of the mouse, where Release is released, buttons common events:

[quote] release release Releaseoutside External Press Press The effect area of ​​the ROLLOVER mouse to enter the button in the induction area of ​​the ROLLOUT mouse [/ quote]

It is very clear now: AS written on the button is one of this format: [quote] ON (Event) {To execute the code} [/ quote]

[Color = Maroon] [B] 3, MC (Movie Clip) [/ B] [/ color] If you understand the above content, then write the AS and write on the button on the MC. The operation method is to click the MC and then open the AS panel. See example [quote] onclipevent ([color = red] load [/ color]) {stop ();} [/ quote]

Similarly, the MC requires an event to trigger the implementation of the AS. Translation This code is

[quote] When the clip (load) {stop} [/ quote]

The red code also represents an event. MC's events have the following:

[quote] LOAD load, executed when MC appears. That is, unless this MC is uninstalled, the code in the LOAD event is only executed with a unload uninstallation, and each frame exists in EnterFrame when the MC is uninstalled. Each frame exists in the MC is executed. If your scene has 100 frames, a MC starts from 41 frames to 100 frames disappeared, then the code above this MC performs 60 mousedown to press the mouse and count anywhere in the scene. And the button is different, Mousemove mobile mouse, as long as the mouse is moved, execute the code mouseup release mouse [/ quote] You have to clear: The code written on the MC must always always have this format:

[quote] onclipEvent (event) {code} [/ quote]

See here, if you understand what is different from the frame, buttons, the code on the MC is different, the task is completed

转载请注明原文地址:https://www.9cbs.com/read-34232.html

New Post(0)