所以假设我有以下代码:
public function first(text:String):String {
_text = text;
dispatchEvent(event);
//Want this statement to return the value of _text
//after handler has finished transforming text.
return _text;
}
//handles the event
public function handler(event:Event):void {
//does things, then changes the value of _text
_text = "next text that first needs to return";
}
我如何确保方法(first)在被(handler)转换后返回正确的_text值?
先感谢您!