Hi,
The following is the working code. I want to add an “If statement” to achieve the following result:
If the Panel1 is at the bottom of the page (y:750), then it goes upwards (y:150) when user clicks on Panel1_btn, if it is already upwards (y:150) then it should goes downwards (y:750) when it is clicked on the same button. How to re-code it? The following is my code:
Panel1_btn.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(event:MouseEvent):void {
var Panel1Tween:TweenMax = new TweenMax(Panel1, 6, {y:450, delay:1, ease:Strong.easeOut});
}