You can create a counting integer variable that adds every time it enters the snowflake function and a goal variable to tell the function at which frame number to initiate the code in the function, like this:
I believe this would work, there may be an error in the code, have not checked it.Code:stage.addEventListener(Event.ENTER_FRAME, snowflake); //init variables var count:int=0; var goal:int=int(Math.random()*50+50);//this will give you a number from 50-100 function snowflake(event:Event):void{ if(count>=goal){ count=0; goal=int(Math.random()*50+50); //add your code that was initially in your function here } }




Reply With Quote