でコールバックを使用する方法:それでは、私は次のコードを持っているとしましょうActionScriptの
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";
}
どのように私はこの方法は(最初の)それは(ハンドラ)によって変換された後_textの正しい値を返すことを確認します?
ありがとうございます!
ActionScriptは、形式 '名使用しています:引数のtype'が、ない'タイプNAME'を。 – Marty
私はイベントで正しいと思いましたが、私はflexとjavaの間であまりにも多くの切り替えを行っています。これは混乱です。しかし、それを指摘していただきありがとうございます:) – user220755
ええ私はこれとC#の間で同じ問題があります:P – Marty