Permalink
Browse files

Making sure all eventListeners are removed properly

  • Loading branch information...
1 parent a2f64dd commit 04f09f47c5167eb4cfb3dbe9a60472836945e026 @vancura vancura committed Nov 8, 2010
@@ -365,14 +365,14 @@ package com.falanxia.moderatrix.widgets {
if(value == DebugLevel.HOVER) {
debugSpr.visible = false;
- this.addEventListener(MouseEvent.ROLL_OVER, onDebugOver);
- this.addEventListener(MouseEvent.ROLL_OUT, onDebugOut);
+ addEventListener(MouseEvent.ROLL_OVER, onDebugOver);
+ addEventListener(MouseEvent.ROLL_OUT, onDebugOut);
}
else {
debugSpr.visible = true;
- this.removeEventListener(MouseEvent.ROLL_OVER, onDebugOver);
- this.removeEventListener(MouseEvent.ROLL_OUT, onDebugOut);
+ removeEventListener(MouseEvent.ROLL_OVER, onDebugOver);
+ removeEventListener(MouseEvent.ROLL_OUT, onDebugOut);
}
_debugLevel = value;
@@ -452,8 +452,8 @@ package com.falanxia.moderatrix.widgets {
protected function removeChildren():void {
- this.removeEventListener(MouseEvent.ROLL_OVER, onDebugOver);
- this.removeEventListener(MouseEvent.ROLL_OUT, onDebugOut);
+ removeEventListener(MouseEvent.ROLL_OVER, onDebugOver);
+ removeEventListener(MouseEvent.ROLL_OUT, onDebugOut);
allWidgets[_idx] = null;
@@ -84,7 +84,7 @@ package com.falanxia.moderatrix.widgets.meta {
override public function destroy():void {
_buttonOff.removeEventListener(ButtonEvent.RELEASE_INSIDE, onToggle);
_buttonOn.removeEventListener(ButtonEvent.RELEASE_INSIDE, onToggle);
- this.removeEventListener(Event.ENTER_FRAME, onInvalidate);
+ removeEventListener(Event.ENTER_FRAME, onInvalidate);
forceRelease();
@@ -277,13 +277,13 @@ package com.falanxia.moderatrix.widgets.meta {
protected function invalidate():void {
- this.addEventListener(Event.ENTER_FRAME, onInvalidate);
+ addEventListener(Event.ENTER_FRAME, onInvalidate);
}
private function onInvalidate(e:Event):void {
- this.removeEventListener(Event.ENTER_FRAME, onInvalidate);
+ removeEventListener(Event.ENTER_FRAME, onInvalidate);
draw();
}

0 comments on commit 04f09f4

Please sign in to comment.