メソッドを持つEventManagerクラスがあります:
public function addEvent(obj:IEventDispatcher, event:String, listener:Function,
useCapture:Boolean = false, priority:int = 0,
useWeakReference:Boolean = false):void
{
obj.addEventListener(event, listener, useCapture, priority, useWeakReference);
[here event is pushed in my stack]
}
私はこれをしたい:
public class CustomClass extends Sprite
{
public override function addEventListener(type:String, listener:Function,
useCapture:Boolean = false, priority:int = 0,
useWeakReference:Boolean = false):void
{
eventManager.addEvent(this, type, listener, useCapture, priority, useWeakReference);
}
}
しかし、結果として、呼び出しスタックは次のようになります。
customClass.addEventListener ->
eventManager.addEvent ->
customClass.addEventListener ->
eventManager.addEvent ->
customClass.addEventListener ->
...
など...eventManager.addEventでobj.addEventListenerを呼び出すため
たぶん、この問題の解決策を教えていただけますか?