Flash tutorials
Home 3D (2) Actionscripting (65) Animation (100) Audio (4) Drawing (7) Full flash sites (4) Getting Started (15) Navigation (25) Special Effects (52) Text Effects (38)

Stars dancing

11.10.2006, 15:2    Total views: 33936
In this tutorial I will show you how to create stars dancing animation using the action script code.

Step 1

Create a new flash document and set Frame rate to 45 fps (Frames per Second).

Preview

 



Step 2


Take the Line Tool (N), and drag a little "star" like it is shown on the picture below.



Step 3

Select the "star" and press F8 on the keyboard (Convert to Symbol) to convert it into a Movie Clip.



Step 4

Double click on a new made Movie Clip ("star") to go in its inside.

Step 5

Then, while your "star" is still selected, press again F8 on the keyboard (Convert to Symbol) and convert it into a Graphic Symbol.



Step 6

Click on frame 7 and press F6 (Keyframe). Then click on frame 12 and frame 17 and press again F6. Look at the picture below!



Step 7

Go back on frame 12, take the Free Transform Tool (Q), and decrease the "star" a little.

Step 8

Click on frame 12, open the Properties Panel (Ctrl+F3), and under Tween choose Motion. Then, under Rotate choose CW and under Ease set 100. Look at the picture below!



Step 9

Click on frame 7, and in Properties Panel under Tween choose again Motion. After that, under Rotate choose CCW and set Ease to 100.

Step 10

Click on frame 25 and press F5.



Step 11

Go back on main scene (Scene 1), Select the "star", open the Action Script Panel (F9), and paste this script:

onClipEvent(enterFrame){
if(random(25)==1){
num=random(25);
}
this.gotoAndPlay(num);
}

Step 12

Select again the "star" and press Ctrl+D on the keyboard few times to Duplicate it. See the picture below.



Step 13

Then, set the "stars" in the position which you like.

Test your Movie (Ctrl+Enter).

We're done!

Download source file (.fla)
Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Top tutorials

1. Advanced full flash site - Part 1
Total views: 221534

2. Water effect
Total views: 166040

3. Photo slide show
Total views: 153641

4. High-tech city animation
Total views: 151459

5. Special Picture Effect
Total views: 146246

Related links