View Single Post
  #1  
Old 26-12-2008, 05:31 AM
.BZU.'s Avatar
.BZU. .BZU. is offline


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Cool how to create Falling Snow animation in flash

See this simple and quickly flash 8 action script lesson and learn how to create falling snow animation in flash. You can use this animation for any holidays header, banner, Christmas card... Using this lesson, you will also learn how to convert any object into a Movie Clip Symbol, how to apply action script code on it using the action script panel and much more!


Step 1

Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the dimensions of your document as whatever you like. Choose some kind of a dark color as background color. Set your Flash movie's frame rate to 27 and click ok.

Name:  2008121720_img1.gif
Views: 405
Size:  8.4 KB

Step 2

Take now the Oval Tool (O). In the Colors portion of the Tool panel, block the Stroke color by clicking on the little pencil icon and then on the small square with the red diagonal line. For Fill color choose white color and draw a "circle" about 4x4 px.

Name:  2008121720_img2.gif
Views: 301
Size:  14.0 KB

Step 3

While the circle is still selected, press F8 key (Convert to Symbol) to convert this circle into a Movie Clip Symbol.

Name:  2008121721_img3.gif
Views: 325
Size:  6.0 KB

Step 4

While the new made Movie Clip (circle) is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Movie Clip "snow". See the picture below!

Name:  2008121721_img4.gif
Views: 289
Size:  1.8 KB

Step 5

Select the Selection Tool (V) and click once on the Movie Clip (circle) to select it. Then, go to the Action Script Panel (F9) and enter this code inside the actions panel:
Code:
onClipEvent (load) {
 movieWidth = 350;
 movieHeight = 263;
 
 i = 1+Math.random()*2;
 k = -Math.PI+Math.random()*Math.PI;
 
 this._xscale = this._yscale=50+Math.random()*100;
 this._alpha = 75+Math.random()*100;
 this._x = -10+Math.random()*movieWidth;
 this._y = -10+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
 rad += (k/180)*Math.PI;
 this._x -= Math.cos(rad);
 this._y += i;
 if (this._y>=movieHeight) {
  this._y = -5;
 }
 if ((this._x>=movieWidth) || (this._x<=0)) {
  this._x = -10+Math.random()*movieWidth;
  this._y = -5;
 }
}
Step 6

Select now the first frame, go again to the Action Script Panel (F9) and enter this code inside the actions panel:

for (k=0; k<50; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}

Now, we're done!

Test your Movie and enjoy!
__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote