Jump to content
Search Community

Tween to TweenLite

Luigi Vercotti test
Moderator Tag

Recommended Posts

Hello

Can you please help me to convert it to your TweenLite, please...

function minimizeWindow(e:MouseEvent):void {

   var fade:Tween;

   if (window01.windowArea.visible) {
       fade=new Tween(window01.windowArea,"alpha",Strong.easeOut,1,0,0.5,true);
       fade.addEventListener(TweenEvent.MOTION_FINISH, fadeFinish);
   } else {
       fade=new Tween(window01.windowArea,"alpha",Strong.easeOut,0,1,0.5,true);
       window01.windowArea.visible=! window01.windowArea.visible;
   }

   fade.start();

   function fadeFinish(e:TweenEvent):void {
       window01.windowArea.visible=! window01.windowArea.visible;
   }
}

Link to comment
Share on other sites

I believe it would be simplified to:

function minimizeWindow(e:MouseEvent):void {
   if (window01.windowArea.visible) {
       TweenLite.to(window01.windowArea, 0.5, {alpha:0, ease:Strong.easeOut, onComplete:fadeFinish});
   } else {
       window01.windowArea.visible=! window01.windowArea.visible;
       TweenLite.to(window01.windowArea, 0.5, {alpha:1, ease:Strong.easeOut});
   }
}

 

But you don't show your fadeFinish() method - I suspect you'd need to eliminate the TweenEvent parameter so that it doesn't complain about expecting 1 parameter and receiving none.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...