Create Snowfall Effect

This tutorial was written for the Flash Designer software, which allows you to create flash animations in a much easier way than by using Macromedia Flash. You may get Flash Designer here.

Download source project t1053.zip (2 kb)

  1. Launch Flash Designer and set movie dimensions 400 x 300 (or any desired).
  2. Change frame delay to "Stop".
  3. Add new frame, change "Frame 1" to "Master Frame (1)"
  4. Go to "Frame 1", select "Master Frame (1)" as the background:
Create a snowflake
  1. Go to "Frame 1"
  2. Draw ellipse about 16x16 pixels, set line width to none
  3. Fill it with radial gradient (center color white, outer color "No Color")
  4. Convert it to sprite ("Edit" > "Convert to Sprite")
  5. Rename it to "Snowflake" and check "ActionScript Target" under "Item" > "Placement Properties"
  6. Move the snowflake sprite outside visible area
Create a background
  1. Go to "Master Frame (1)"
  2. Draw a rectangle 400 x 300 and set line width to none
  3. Fill it with vertical gradient, top color dark blue, bottom color light blue
  4. Center the rectangle on the master frame
Add ActionScript:

Go to "Frame 1", choose "Frame" > "ActionScript" and paste the code:

maxsnowflakes = 100;
var snowflakes = new Array();
for(i=0;i<maxsnowflakes;i++)
{
snowflakes[i] = Snowflake.duplicateMovieClip ("snowflake"+i,100+i);
// put it in random place
snowflakes[i]._x = Stage.width*Math.random();
snowflakes[i]._y = Stage.height*Math.random();
snowflakes[i]._xscale = 40+Math.random()*60;
snowflakes[i]._yscale = snowflakes[i]._xscale;
snowflakes[i].yspeed = Math.random()*4+ 1;
snowflakes[i].increment = -0.025+Math.random()*0.05;
snowflakes[i].onEnterFrame = function() {
this.radians = this.increment + this.radians;
this._y = this.yspeed + this._y;
this._x = Math.sin(this.radians) + this._x;
if (this._y>Stage.height) {
this._y = 0-10;
this._x = 0-10+Math.random()*Stage.width;
}
}
}

Hit F9 for preview.

INFO: to place an object in front of snowflakes, select it, choose "Item" > "Placement Properties" and change the layer to higher value, for example "Layer 3":

image 1


Close    To Top
  • Prev Article-Flash:
  • Next Article-Flash:
  • Now: Tutorial for Web and Software Design > Flash > Flash Video > Flash Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction