|
||||||||||||||||||||||
Welcome To NewFreeTemplates.com Flash Tutorials Area - Cool Snowflakes
Download source project t1053.zip (2 kb)
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":
See also: Hearts
Author: www.flashdesignerzone.com
|
|
|||||||||||||||||||||
|
||||||||||||||||||||||
| All Rights Reserved 2007-2008 by NewFreeTemplates.com | ||||||||||||||||||||||