sumo
July 19th, 2007, 07:46 AM
Hi.
Is there any way to add parameters for a function that I'm calling with Timer?
Normally I would this:
ActionScript Code:
createBalls(5);
function createBalls(num:int):void
{
//some code based on num
}
With Timer:
ActionScript Code:
var myTimer:Timer = new Timer(1000, 1);
myTimer.addEventListener(TimerEvent.TIMER, createBalls);
myTimer.start();
Where to put the parameter for that function in the Timer? Is it even possible?
Is there any way to add parameters for a function that I'm calling with Timer?
Normally I would this:
ActionScript Code:
createBalls(5);
function createBalls(num:int):void
{
//some code based on num
}
With Timer:
ActionScript Code:
var myTimer:Timer = new Timer(1000, 1);
myTimer.addEventListener(TimerEvent.TIMER, createBalls);
myTimer.start();
Where to put the parameter for that function in the Timer? Is it even possible?