Toxiclab.org

Control the Movie Clip

29.3.2006, 17:57
Submited in: Flash | Total Views: 71037

This tutorial will show you how to control a Movie Clip in flash using the Action Script and buttons. You will also learn how to convert any object into a Movie Clip Symbol, how to draw ball shadow, and how to animate it. Let's go!





Example:



Step 1

First, create a ball that is jumping up and down with shadow, in an equivalent way like I've shown you in the previous tutorial (Ball in play).





Step 2


After that insert a new layer and name it Ball1.



Step 3

Draw another one "ball" with shadow in an equivalent way, like you've drawn the first ball. Look at the picture below!



Step 4

Select that second "ball" with shadow, and press F8 key (Convert to symbol) to convert it into a Movie Clip Symbol. See the picture below.






Step 5

Take the Selection Tool (V), and double click on a new made Movie Clip, or choose right click and select Edit in Place.

Step 6

Double click on layer 1 rename its name in ball. After that, insert a new layer above layer ball and name it shadow.

Step 7

Select only the "shadow" and press Ctrl+X key (cut). Then, click on layer shadow and press Ctrl+Shift+V key (Paste in Place). While the "shadow" is still selected, press again F8 key (Convert to symbol) to convert it into a Movie Clip Symbol. See the picture below.




Step 8

Click on frame 15 of layer shadow and press F6 key (Keyframe). After that, click on  frame 30 and press again F6 key. Then, go back on the frame one, take the Selection Tool (V), click once on the"shadow" to select it, open the Properties Panel (Ctrl+F3) and for color choose Alpha and set it to 40% . Then click on frame 15, take the Free Transform Tool (Q) and decrease "Shadow" a little.




Step 9

Take the Selection Tool again (V), click once on the "shadow" to select it, open the Properties Panel (Ctrl+F3), and for Color choose Alpha and set it to 15%. Then, click on frame 30, click once on "shadow" to select it, and in Properties Panel  choose again Alpha and set it to 40%.
After that, click once on shadow layer to select it, and in Properties Panel for Tween choose Motion.

Step 10

Lock layer shadow, select the ball layer,  take the Selection Tool (V), click once on the "ball" to select it and press F8  key (Convert to symbol ) to convert it into a Graphic Symbol. See the picture below.




Step 11

Click on frame 15 of layer ball and press F6 key (Keyframe). After that, click on  frame 30 and press again F6 key. Then, go back on frame 15, select the "ball", and using the mouse or by arrow keys, move it a little up. After that click once on layer ball, open the Properties Panel (Ctrl+F3), and for Tween choose Motion. Look at the picture below!



Step 12

Go back on the main scene (Scene 1), click once on MC (Ball with shadow) to select it, and for <instance name> type ball. See the picture below.





Step 13

Now it's time to create a button. For this example I will use Flash premaid buttons (You can also create your own button). Insert a new layer and name it Buttons.



Lock all layers, except Buttons layer and click on Window - Other Panels - Common Libraries - Button.

Step 14

Then from the Library (Ctrl+L) using the "drag and drop technique" move the gel Right, and gel Stop buttons on the stage and place them wherever you like. Look at the picture below!





Step 15

Click once on gel Right button of the first "ball" to select it, open the Action Script Panel (F9), and paste this script:

on (release) {
play ();
}

Step 16

Click after that on gel Stop button of the first "ball", and in A.S. Panel paste this script:

on (release) {
stop ();
}

Step 17

Click on the gel Right button of second "ball" and paste this script:

on (release) {
ball.play ();
}

Step 18

After that click on the gel Stop button of second "ball" and paste this script:

on (release) {
ball.stop ();
}

We're done!

Bye!

Download example (61 KB)

Are you a website owner?
Click here to register and submit your tutorials!

Browse by category


Most popular tutorials