Web
Article

Flash Script – Falling Snow Effect

By Georgina Laidlaw


Download the sample files here.

1. Create a small snowflake I used a small circle filled with white color.

2. Convert this snowflake object to a movie clip, and give it an instance name of "snow".

3. Now, go in to the time line of this snow movie clip, and create three keyframes in this layer.

4. In the first key frame give action:

mov = 0; 
ran = getProperty("", _x);

5. In the second key frame give action:

setProperty ("", _y, mov=mov+2); 
snowy = getProperty("", _y);
setProperty ("", _x, (ran+random(2)));
if(snowy > 310)
{
setProperty ("", _y, 50);
mov=0;
ran = ran - 10;
}

6. In the third key frame give action:

gotoAndPlay (2);

7. Now go back to the main timeline, and create two key frames in this layer.

8. Insert these actions into the first key frame:

if (snowparticles<150) 
{
duplicateMovieClip("snow","snow" add i,i)
scale=random(60)+10
setProperty("snow" add i,_x,random(450))
setProperty("snow" add i,_xscale,scale)
setProperty("snow" add i,_yscale,scale)
snowparticles++
i++
}

9. Insert this action into the second key frame:

gotoAndPlay (2);

That’s it! You have created your own snow effect.

Meet the author
Georgina has more than fifteen years' experience writing and editing for web, print and voice. With a background in marketing and a passion for words, the time Georgina spent with companies like Sausage Software and sitepoint.com cemented her lasting interest in the media, persuasion, and communications culture.
  • Jay Svoboda

    how do you add a clickTAG action to this snow effect? Can i add it to the existing auto script? or do i need to create a new button / layer and add the action to that?

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in Front-end, once a week, for free.