Jump to content
Search Community

TimelineMax addlabel tl.duration error

kit test
Moderator Tag

Recommended Posts

Hello, I am trying to add label in between a Timeline animation, and the code are as follow:

 

 

var footerTL:TimelineMax = new TimelineMax();

footerTL.append(TweenMax.from(copyright,0.5,{alpha:0,y:"+25"}));

footerTL.append(TweenMax.from(quitBTN,0.5,{alpha:0,y:"+25"}),-0.4);

footerTL.append(TweenMax.from(supportBTN,0.5,{alpha:0,y:"+25"}),-0.4);

footerTL.addLabel("hideButton", footerTL.duration);

footerTL.append(TweenMax.from(changePassBTN,0.5,{alpha:0,y:"+25"}));

footerTL.addLabel("showButton", footerTL.duration);

 

when publish, this error prompt:

1067: Implicit coercion of a value of type Function to an unrelated type Number.

 

any idea?

Link to comment
Share on other sites

Hi Kit,

 

Welcome to the GreenSock forums.

 

It looks like you are using the old syntax for v11 with the new version of GSAP 12.

In version 12 the duration property is now a method.

 

Good v11:

tl.addLabel("label1", tl.duration);

 

Good v12:

tl.addLabel( "label1", tl.duration() );

 

in v12 if you want the label to go at the current end of the timeline you can simply use append()

tl.append( "label1" ); //sweet!

 

Happy Tweening!

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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...