as3,这样写的addEventListener要如何removeEventListener?



 addEventListener(Event.ENTER_FRAME,function(evt:Event){
    if(!!heroObj.aRun2){
        removeEventListener(Event.ENTER_FRAME,retuObjEnter);
        callback.apply(null,[heroObj,"null","null"]);
    }
});

上面那样明显是不行的,如果有个写法能代表thisFunction,或者thisEventListener也许就可以了吧

flash as3

秒速5微米 10 years, 10 months ago

匿名事件函数中添加


 removeEventListener(Event.ENTER_FRAME, arguments.callee);

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/arguments.html

O4LOVE answered 10 years, 10 months ago

Your Answer