Flash in response to mouse action to attack the explanation

Source: Internet
Author: User

   First, the realization of ideas

We first look at the effect of the example, the mouse in the scene in different places across, the scene of the villain will have different responses. It is especially interesting that when the speed of the mouse is different, the reaction is different. This is similar to the implementation of the game.

In general, the realization of the idea is probably like this: first make a good mouse across different parts of the response to the action effects, and then use a few movie clip to capture the mouse across the position and speed, and then play different action effects, this is what we see the effect.

  Second, the implementation process

Now let's look at the specific implementation process.

1, press "CTRL + N", create a new Flash file, press "CTRL + F8", create a new movie Clip, named "All Motion".

2, enter this movie Clip, right click on the name of the layer, insert "label", "Action", "sound", "idle" four layers, in the "label" layer of the first frame of the property panel to set the label "C_idle", Click the right mouse button on frame 34th, inserts a keyframe and sets the label for this frame to "Ml_w," in the same order, in 47th, 77th, 89th, 139th, 154th, 168th, No. 220, No. 255, No. 267, No. 310, No. 358 frames, Frame No. 372, insert a key frame on frame No. 430, frame No. 446, and set the frame label to "ml_s", "Mr_w", "mr_s", "Tl_m", "Tl_w", "tl_s", "Tr_m", "Tr_w", "tr_s", "B_m", "Bl_w", "bl_s", "Br_w"

, "br_s".

3, in the "Action" layer of the 33rd frame click on the right mouse button, insert a keyframe, in this frame of the Action script panel above add statements: gotoAndPlay (1); Similarly, the 46th frame, 75th frame, 85th frame, 120th frame, 151th frame, 165th frame, No. 205 frame, No. 252 frame, No. 266 frame, No. 301 frame, No. 357 frame, No. 369 frame, No. 420 frame, No. 440 frame, No. 464 frame are inserted into a keyframe. and add the statement above the action Script panel of the frame respectively: gotoAndPlay (1);

4. Insert a keyframe above the 34th frame of the "idle" layer, and draw a villain with the drawing tool in the scene in frame 1th of the layer, as shown in Figure 1. This is displayed when there is no mouse action.

5, in the "layer1" layer on the 34th and 45th frames, insert a key frame, between the 34th frame to 45th frame to create when the mouse at a slower speed from the left arm of the movie clip effect. And so on, between frames 34th to 45th, create a movie clip effect when the mouse is slowly moving from the left arm of a small person. Between frames 47th to 74th, the movie clip effect is produced when the mouse moves from the left arm of the person to a relatively fast speed. Create a movie clip effect on the right arm of the mouse at a slower speed between frames 77th through 84th. Between frames 89th to 119th, the movie clip effect is produced when the mouse moves from the right arm of a small person to a relatively fast speed.

6, between the 139th frame to the 150th frame to produce when the mouse to the middle of the speed from the left side of the head across the movie clip effect. Create a movie clip effect from the left head of the mouse at a slower speed between frames 154th to 164th. Between frames 168th to No. 204, the movie clip effect is produced when the mouse moves from the left head to the relatively fast speed. Create a movie clip effect between frames from frame No. 220 to No. 251 when the mouse is at a moderate speed from the right head of a small person. Create a movie clip effect between frames from frame No. 255 to No. 265 when the mouse is at a slower speed from the right head of a small person. Between frames No. 267 to No. 300, the movie clip effect is produced when the mouse moves from the right head to the relatively fast speed.

7, between the No. 310 frame to the No. 356 frame to produce when the mouse to the middle of the speed of the leg across the movie clip effect. Between frames No. 358 to No. 368, the movie clip effect is produced when the mouse is slowly moving from the left leg of a small person. Between frames No. 372 to No. 419, the movie clip effect is produced when the mouse moves from the left leg of the small person to a faster speed. Between frames No. 430 to No. 439, the movie clip effect is produced when the mouse moves from the right leg to a slower speed. Between frames No. 446 to No. 463, the movie clip effect is produced when the mouse moves from the right leg to a relatively fast speed.

Note 1: Define variables to determine whether the mouse is moving across the object in a slower, medium, and faster speed.

Note 2: Hides the object used to capture the mouse action.

Note 3: Initializes the mouse parameters.

Note 4: This function is used to capture the speed and the position of the mouse across.

Note 5: This function is used to determine the speed of the mouse across, respectively, strong, medium and weak.

Note 6: This function is to judge the position of the mouse, respectively, corresponding to the scene of the object's head, hands, feet.

Note 7: In this function, play the corresponding scene triggered by the mouse action.

Note 8: This is the starting function of the entire scene, the constant loop, constantly responding to the mouse action.

Small series for everyone to edit the flash in response to mouse strike action hope to help everyone!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.