Created
January 3, 2011 06:51
-
-
Save destroytoday/763190 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected var shape:Shape = new Shape(); | |
public function invalidate():void | |
{ | |
shape.addEventListener(Event.ENTERFRAME, invalidateHandler); | |
} | |
protected function invalidateHandler(event:Event):void | |
{ | |
stage.removeEventListener(Event.ENTERFRAME, invalidateHandler); | |
validate(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function invalidate():void | |
{ | |
stage.addEventListener(Event.RENDER, invalidateHandler); | |
stage.addEventListener(Event.ENTERFRAME, invalidateHandler); | |
stage.invalidate(); | |
} | |
protected function invalidateHandler(event:Event):void | |
{ | |
stage.removeEventListener(Event.RENDER, invalidateHandler); | |
stage.removeEventListener(Event.ENTERFRAME, invalidateHandler); | |
validate(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected var timer:Timer = new Timer(0.0, 1); | |
public function TimerInvalidation() | |
{ | |
timer.addEventListener(TimerEvent.TIMER_COMPLETE, invalidateHandler); | |
} | |
public function invalidate():void | |
{ | |
timer.reset(); | |
timer.start(); | |
} | |
protected function invalidateHandler(event:TimerEvent):void | |
{ | |
validate(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment