Search Tutorials
Adding some actions.Select SnowFlake on the stage ( just mouse left-click on MovieClip ) and press F9 to bring up it's actions. Put this actions (if you want just paste this actions you should turn to Expert Mode before.)
onClipEvent (load) {
function Init() {
spdSnowFlake = 0.05+_root.spdSnowFlake*random(20)/10;
if (spdSnowFlake<0.2) {
spdSnowFlake = 0.3;
}
ampSnowFlake = 1+_root.ampSnowFlake*random(3);
rdxSnowFlake = spdSnowFlake/(1+random(10));
if (rdxSnowFlake>0.3) {
rdxSnowFlake = 0.14;
}
rotSnowFlake = 0.5+random(4);
this._x = random(_root.Height-10);
this._visible = true;
}
function Reset() {
this._visible = false;
this._y = _root.Top;
Init();
}
if (this._name<>"snowflake"){
Init();
}
}
onClipEvent (enterFrame) {
if (this._name<>"snowflake") {
// delta x of x coordinate
this.dx = this.dx+this.rdxSnowFlake;
if (this.dx>360) {
this.dx = this.dx-360;
}
this._rotation = this._rotation+rotSnowFlake;
// new snowflake x, y coordinates
this._x = this._x+this.ampSnowFlake*Math.sin(this.dx);
this._y = this._y+this.spdSnowFlake;
// if snowflake has fallen down then reset and init it's values.
if (this._y>_root.Bottom) {
this.Reset();
}
}
}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|