# Changing the speed of Falling Snow for Flash CS4/AS3

**URL:** <https://forum.kirupa.com/t/changing-the-speed-of-falling-snow-for-flash-cs4-as3/316190>\
**Category:** Uncategorized\
**Created:** [November 15, 2010, 7:18pm UTC](https://forum.kirupa.com/t/changing-the-speed-of-falling-snow-for-flash-cs4-as3/316190 "2010-11-15T19:18:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjodoin](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mjodoin](https://forum.kirupa.com/u/mjodoin)\
**Post date:** [November 15, 2010, 7:18pm UTC](https://forum.kirupa.com/t/changing-the-speed-of-falling-snow-for-flash-cs4-as3/316190/1 "2010-11-15T19:18:48Z")

</div>

Hello everyone

This is my fist time using this Forum. I have just completed the tutorial **Falling Snow** for Flash CS4/AS3 and actually replaced the flakes for leaves. For the most part the leaves seam to fall perfectly except for the some that are falling to slow. I want to make them fall more quickly. I think I need to change the variables in the Action Script but I am just not sure where and what to change. Please Help!

here is my code:

package  
{

import flash.display._;  
import flash.events._;

public class leaf extends MovieClip  
{

private var xPos:Number = 0;  
private var yPos:Number = 0;

private var xSpeed:Number = 0;  
private var ySpeed:Number = 0;

private var radius:Number = 0;

private var scale:Number = 0;  
private var alphaValue:Number = 0;

private var maxHeight:Number = 0;  
private var maxWidth:Number = 0;

public function leaf()  
{

SetInitialProperties();

}

public function SetInitialProperties()  
{

//Setting the various parameters that need tweaking  
xSpeed = .05 + Math.random()\*.1;  
ySpeed = .5 + Math.random()\*3;  
radius = .5 + Math.random()\*2;  
scale = .5 + Math.random();  
alphaValue = .5 + Math.random();

var stageObject:Stage = this.stage as Stage;  
maxWidth = stageObject.stageWidth;  
maxHeight = stageObject.stageHeight;

this.x = Math.random()\*maxWidth;  
this.y = Math.random()\*maxHeight;

xPos = this.x;  
yPos = this.y;

this.scaleX = this.scaleY = scale;  
this.alpha = alphaValue;

this.addEventListener(Event.ENTER\_FRAME, Moveleaf);

}

function Moveleaf(e:Event)  
{

xPos += xSpeed;  
yPos += ySpeed;

this.x += radius\*Math.cos(xPos);  
this.y += ySpeed;

if (this.y - this.height \> maxHeight)  
{

this.y = -10 - this.height;  
this.x = Math.random()\*maxWidth;

}

this.rotation += xSpeed;

}

}

}
