You can't.
But you do have alternatives. The easiest way is to put poo in a scope which is accessible to both wait_for_flv and attach_menu. Simply move it up to the class level:
Code:
private var poo;
public function wait_for_flv() {
poo = "plop";
var myTimer:Timer = new Timer(5000, 1);
myTimer.addEventListener("timer",attach_menu);
myTimer.start();
}
public function attach_menu(event:TimerEvent):void {
trace(poo);
}
This is kind of clumsy, but not terrible.
A second choice would be to create an anonymous thunk function as an event handler.
Code:
public function wait_for_flv() {
var poo = "plop";
var myTimer:Timer = new Timer(5000, 1);
myTimer.addEventListener("timer",makeAttachMenuListener(poo));
myTimer.start();
}
private function makeAttachMenuListener(poo:String):Function{
return function(event:Event):void{
attach_menu(poo);
}
}
public function attach_menu(p:String):void {
trace(p);
}
This technique is more sophisticated, but be VERY aware that creating anonymous functions to use as event listeners is a fast-track to memory leaks unless you are very careful. This is also not a true thunk, as it takes an argument, but that's merely a technicality.