This tutorial will help you to learn how to apply shake effect on any object using the Action Script. You will also learn how to use instance name, how to apply action script code on text and more.Example:
Step 1Start Flash.
, and draw something or type any text. For this example I will type and draw this:
Select one part of object. I'm select this part:
After you have selected one part of object, press F8 key(Convert to Symbol), to convert that part into a Movie Clip Symbol. See the picture below.Step 3
Double-click on the movie clip on stage with the Selection tool (V). You should now be inside the movie clip. While the part of object is still selected, press again F8 (Convert to symbol), to convert it again into a Movie Clip Symbol.
After that, go to the Properties Panel (Ctrl+F3), below the stage and for <instance name> type tremble. See the picture below.Step 4
Create a new layer above layer 1, and name it Action.Step 5
Select the first frame of layer Action, open the Action Script Panel (F9) and paste this script:
a = 3;Step 6
b = 6;
c = 9;
duplicateMovieClip(tremble, "tremble" add c, c);
tremble._x = random(a);
tremble._y = random(b);
tremble._alpha = random(45);
tremble._rotation = random(a);
Click on frame 2 of layer picture and press F6. After open go to the Action Panel again, and paste this script:
Go back to the main scene (Scene1) and Test the movie (Ctrl+Enter). You'll need to get something like this:Step 8
Now, the shake effect for first part of our object is over. Repeat steps 2-7 in an equivalent way for all other parts.
Have a nice day!Download example