Jump to content
Search Community
weblongo test
Moderator Tag

Recommended Posts

I have this code that rotates a movie clip.... I use all the time, but it works great  in the old timeline max but not in the new can someone help me fix it..

 

import com.greensock.*;
import com.greensock.easing.*;
 
var flipSpeed:Number = 0.3; 
flipper.back.rotationY = -180;
flipper.back.alpha=0;
 
flipper.addEventListener(MouseEvent.CLICK, flipCard1);
var isFlipPlaying1 = false;
var tl:TimelineMax = new TimelineMax({paused:true});
 
tl.append(TweenMax.to(flipper.front, flipSpeed, {rotationX:180, visible:false, ease:Linear.easeNone}))
tl.append(TweenMax.to(flipper.back, 0, {alpha:1, immediateRender:false}))
tl.append(TweenMax.to(flipper.back, flipSpeed, {rotationX:0, ease:Linear.easeNone}))
 
function flipCard1(event:MouseEvent):void
{
 
switch (isFlipPlaying1)
{
case true :
isFlipPlaying1 = false;
trace("playing false");
tl.tweenTo(0);
break;
case false :
isFlipPlaying1 = true;
trace("playing true");
tl.tweenTo(tl.duration);
break;
}
}
 
Link to comment
Share on other sites

Yes, the problem is most likely this line:

tl.tweenTo(tl.duration);

in v12 duration, time, progress and other properties are now methods.

 

so you would use

tl.tweenTo(tl.duration())

This switch from properties to methods is probably the most common change you will need to adjust to.

 

Check out the features of v12 here: http://www.greensock.com/v12/

Be sure to expand the list to read all  40 enhancements. Item 15 discusses the change from properties to methods

  • Like 1
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...