Created
January 19, 2011 13:03
-
-
Save Stray/786139 to your computer and use it in GitHub Desktop.
Toggle the position of a panel by conditional (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 _isGoingUp:Boolean = false; | |
| private function togglePanelPosition(e:MouseEvent):void | |
| { | |
| var yPos:Number = ON_STAGE_Y; | |
| if(_isGoingUp) | |
| { | |
| yPos = OFF_STAGE_Y; | |
| } | |
| moveTo(yPos); | |
| _isGoingUp = !_isGoingUp; | |
| } | |
| 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