In this part of the tutorial, I'll tell you the next video clip of the incident, later to continue introducing video clips of the event function and add the method, we should understand that the whole idea of teaching: Guan Jianzhen - button - video clip ...
Actually, the movie clip with the button is similar, in the process of learning to learn all of the shining.
Video clip is the MovieClip, we generally referred to as MC, MC is generally onClipEvent () handler to handle events. It likes of which have the following nine kinds of it:
1, load: the current MC is loaded and ready to display before the event is triggered. This event can generally do some initialization work, such as: variable definition, assignment, loaded as documents, etc., very useful.
2, unload: unload the current MC is ready to trigger the event before it disappears.
3, enterFrame: each MC calculation of the current contents of the frame on the trigger of the event. You can do basic understanding of the timeline on every broadcast of a Guan Jianzhen trigger this event, particularly useful, such as we do to navigation menu. General circulation in the need for more testing when you will think of this event.
4, mouseMove: when the mouse moves triggered the event. Contrast button in the rollOver.
5, mouseDown: when the left mouse button pressed to trigger the event. Contrast button in the press
6, mouseUp: when the left mouse button up when the event is triggered. Contrast button in the release.
7, keyDown: when the keyboard key is pressed to trigger the event.
8, keyUp: When the keyboard release button is pressed when the event is triggered. Contrast keyPress.
9, data: current MC when new data is received to trigger the event. The incident with the loadVariables () and loadMovie () function combines the two most closely.
See, you will feel no special right MC, compared with the button on the multi-load, unload, enterFrame, data, for mouse button events not fine it. Events 9 above, is commonly used load, enterFrame. :)
Combination of the following examples we feel these events under the MC. Use to like here on () function.
onClipEvent (movieEvent) (
/ / Here is your statement
MovieEvent here is our big event of 9 described above in one or more.
Requirements: Be a flash, see MC events of interest.
1, the new flash document.
2, the new MC components yuan, lightly draw a circle better.
3, to build an MC component yuan_mc, dragged into the component yuan, to create a motion animation, add a new layer, in the first Guanjian Zhen plus as: stop (); is this mc is a sports movie, start it is stopped.
4, a new layer yuan_mc, drag the component yuan_mc people.
5, the new four layers are named: show_txt, showef_txt, showload_txt, showcont_txt, in each layer and put on a dynamic text, the corresponding variables: show_txt, showef_txt, showload_txt, showcont_txt. In order to show the current state.
6 points in the MC layer yuan_mc components yuan_mc, plus as.
onClipEvent (load) (
_root.showload_txt = "load event is complete!";
_root.showcont_txt = 0;
onClipEvent (mouseDown) (
_root.show_txt = "now is: mouseDown event!";
onClipEvent (mouseMove) (
_root.show_txt = "now is: mouseMove event!";
onClipEvent (keyDown) (
_root.show_txt = "now is: keyDown event!";
onClipEvent (keyUp) (
_root.show_txt = "now is: keyUp event!";
onClipEvent (enterFrame) (
_root.showcont_txt + +;
_root.showef_txt = "enterFrame event going forward:";
The above code you should be able to see to understand, is the _root. Is the meaning of the main timeline, we are dedicated to the back. Dynamic text not speak, do not understand jump, this example on a purpose, let everyone know that the 9 events Bale. Eyes closed imagine a function for MC onClipEvent event have? Know that the finger hook up on it.