# Leaves speed in a flash header

**URL:** <https://forum.kirupa.com/t/leaves-speed-in-a-flash-header/250476>\
**Category:** Uncategorized\
**Created:** [January 29, 2008, 10:15pm UTC](https://forum.kirupa.com/t/leaves-speed-in-a-flash-header/250476 "2008-01-29T22:15:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lasadorian](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@lasadorian](https://forum.kirupa.com/u/lasadorian)\
**Post date:** [January 29, 2008, 10:15pm UTC](https://forum.kirupa.com/t/leaves-speed-in-a-flash-header/250476/1 "2008-01-29T22:15:57Z")

</div>

function genLeaves()  
{  
for (i = 0; i \< maxLeaves; i++)  
{  
var \_loc2 = attachMovie(“blad”, “blad” + i, 200 + i);  
\_loc2.\_x = randRange(2000, 520);  
\_loc2.\_y = randRange(280, 330);  
\_loc2.t = 1;  
\_loc2.onEnterFrame = function ()  
{  
moveLeaf(this);  
};  
currentLeaves = currentLeaves + 1;  
} // end of for  
} // End of the function  
function moveLeaf(mc)  
{  
mc.\_x = mc.\_x - (5 + Math.cos(mc.t) \* 20);  
mc.\_y = mc.\_y - Math.sin(mc.t) \* 10;  
mc.\_rotation = mc.\_rotation + mc.t \* 2;  
if (mc.t \< 6.500000E+000)  
{  
mc.t = mc.t + randRange(1.000000E-001, 1.500000E-001);  
} // end if  
if (mc.\_x \< 0)  
{  
removeLeaf(mc);  
} // end if  
} // End of the function  
function removeLeaf(mc)  
{  
currentLeaves = currentLeaves - 1;  
mc.removeMovieClip();  
//if (currentLeaves == 0)  
//{  
// genLeaves();  
// } // end if  
} // End of the function  
function randRange(min, max)  
{  
var \_loc1 = Math.floor(Math.random() \* (max - min + 1)) + min;  
return (\_loc1);  
} // End of the function  
var maxLeaves = 8;  
var currentLeaves = 0;  
genLeaves();  
stop ();

ok so i have a leave animation i found on another site. the actual leaf’s linkage is called blad…

my question is how can i slow down this animation… it generates a few leaves and swirls them then flys them off screen… i would prefer them being slower… any help would be welcome.
