Snow Effect With Wind

1. Make a new 300×200 flash document, and set its Background colour to something else than plain white (I used #CCCCCC here)

2. Let's start by adding this Action Script in the first Layer, First Frame:

image 1

speed1 = .9;
mw =300;
//Movie Width
mh = 200;
//Movie Height
snowint =50
//the larger the interval is, lesser it's going to snow
//++++++++++++++++++++++++++
function randRange(min, max) {
var randomNum = Math.round(Math.random()*(max-min))+min;
return randomNum;
}
setInterval(CursorMovement, 40);
function CursorMovement() {
mc._x = speed1*(mc._x-_xmouse)+_xmouse;
interval = (mc._x/mw*6);
}
function snow() {
i++;
duplicateMovieClip(snowflake, ["snowflake"+i], i);
}
setInterval(snow, snowint);

3. Now go to Insert -> New Symbol -> Movie Clip, Name it SnowFlake.

Select the Oval tool, and make sure that the Stroke Colour is set to No Color, and that the Fill Colour is set to White:

image 2

Now with the Oval tool you selected, draw a circle while pressing SHIFT (to make it a perfect circle), and make sure you center it with the align tool.

4. Now go back to the main stage/Scene 1:

image 3

Drag&Drop, the movie clip SnowFlake you just made and give it: snowflake as its istance name.

And, attach this Action Script to the movie clip SnowFlake you just Drag&Dropped

onClipEvent (load) {
if (this._name == "snowflake") {
_parent.i = 0;
}
this._alpha = _parent.randRange(80, 100);
//Alpha Transparency of snowflake
this._width = _parent.randRange(5, 10);
//Snowflakes' width
this._height = this._width;
//Keep round shaped snowflakes
this._x = _parent.randRange(-100, _parent.mw+100);
this._y = _parent.randRange(0, -50);
speed = _parent.randRange(2, 5);
//Folling speed.
}
//+++++++
onClipEvent (enterFrame) {
this._y += speed;
this._x += _parent.interval-3;
if (this._y>_parent.mh+20) {
this.removeMovieClip();
}
}

5. Go to Insert -> New Symbol -> Movie Clip, Name it MC.

Keep it blank, and go back to the Main Stage/Scene 1

image 4

Drag&Drop the movie clip MC to the Main stage, and give it:mc as its instance name.

image 5

And you're done. Happy holidays/Merry Christmas, and happy new year.


Close    To Top
  • Prev Article-Flash:
  • Next Article-Flash:
  • Now: Tutorial for Web and Software Design > Flash > Special Effect > 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