Functions in AS3 are first class members, which means they can be passed around as arguments. One way you can set a delay is by defining a 'delaying' function like so:
function delayedFunctionCall(delay:int, func:Function) {
trace('going to execute the function you passed me in', delay, 'milliseconds');
var timer:Timer = new Timer(delay, 1);
timer.addEventListener(TimerEvent.TIMER, func);
timer.start();
}
function walkRight() {
trace('walking right');
}
function saySomething(to_say:String) {
trace('person says: ', to_say);
}
//Call this function like so:
delayedFunctionCall(2000, function(e:Event) {walkRight();});
delayedFunctionCall(3000, function(e:Event) {saySomething("hi there");});
The function that you need delayed needs to be 'wrapped' with an anonymous function like this because .addEventListener methods expects to be passed a function with just one parameter: the Event object.
(You can still specify the arguments you want to pass to the delayed function within the anonymous function, though.)