Template Categories

templates categories Automobiles
templates categories Business
templates categories CSS Templates
templates categories E-Commerce
templates categories Education
templates categories Fashion
templates categories Greeting Cards
templates categories Hotels
templates categories Jewelry
templates categories kids
templates categories Models
templates categories Music - Films
templates categories Night Club
templates categories Real Estate
templates categories Restaurant
templates categories Software
templates categories Sports
templates categories Travel
templates categories Web-design
templates categories Wedding

Tutorial Categories

tutorial categories AJAX
tutorial categories CSS
tutorial categories Dreamweaver
tutorial categories Flash
tutorial categories FTP - File Transfer
tutorial categories HTML Emails
tutorial categories Javascript
tutorial categories Microsoft Excel
tutorial categories Microsoft Windows
tutorial categories Microsoft Word
tutorial categories MySql
tutorial categories Photoshop
tutorial categories Php
tutorial categories Windows Movie Maker
tutorial categories Xhtml / Html
Creating snow with simple actionscript - Flash Tutorial

BELOW IS THE EXAMPLE OF WHAT WE ARE GOING TO CREATE.
Open your flash program and set the dimensions. Next import any image to be used as background. In our case we have used a house covered with snow. Name this layer as background or image.
Create a new layer and name it text and write any message or jingle. This is optional.If you do not want to write anything then skip this step. Next create a small circular shaped object - white in colour with either circular tool or with brush. Select this shape and convert it to a movieclip. Name it s_fall. In the same window click on the advanced tab and tick the export for actionscript check box ( linkage ) and name the identifier as s_fall.
Delete this shape as we do not require it anymore. You can find this movie clip in your library.

Next create a new layer above the background layer and name it action. Press F9 and add the following action script.

width = 400;
height = 300;
max = 170;
for (var m = 0; m != max; m++) {
var mc = _root.attachMovie("s_fall", "s_fall"+m, _root.getNextHighestDepth());
mc._x = (Math.random()*(width+20))-10;
mc._y = (Math.random()*(height+20))-10;
mc.yspeed = (Math.random()*1.75)+0.25;
mc.speed = (Math.random()*3)+2;
mc._xscale = mc._yscale=(mc.speed+mc.yspeed)*10;
mc.onEnterFrame = function() {
var angle = Math.atan2(_root._xmouse-(width/2), _root._ymouse)+1.5707963267949;
this._y += Math.sin(angle)*this.speed+this.yspeed;
this._x += Math.cos(angle)*this.speed;
if (this._x>width+10) {
this._x = -10;
} else if (this._x<0-10) {
this._x = width+10;
}
if (this._y>height+10) {
this._y = -10;
} else if (this._y<0-10) {
this._y = height+10;
}
};
}
Change the height and the width as per your needs. Change the variable max to change the density of snow. Other variables which can be changed are the x-axis and y-axis speed of snow fall.
flash snow fall

Test your movie.

Hope you have enjoyed this flash tutorial on creating snow with actionscript.