Created
January 19, 2011 13:11
-
-
Save Stray/786147 to your computer and use it in GitHub Desktop.
Toggle the position of a panel by decoupled handlers (for comparison with other approaches)
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
| private var _nextMotion:Function = revealPanel; | |
| private function togglePanelPosition(e:MouseEvent):void | |
| { | |
| _nextMotion(); | |
| } | |
| private function revealPanel():void | |
| { | |
| moveTo(ON_STAGE_Y); | |
| _nextMotion = hidePanel; | |
| } | |
| private function hidePanel():void | |
| { | |
| moveTo(OFF_STAGE_Y); | |
| _nextMotion = revealPanel; | |
| } | |
| private function moveTo(yPos:Number):void | |
| { | |
| TweenLite.to(this, 1, {y:yPos}); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment