Jump to content
Search Community

Using TimelineMax in Animate

rtania test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I pasted the required gsap script in my html, and I have the actionscript code below. I would like for the balloons to go to the certain y: coordinate and then reverse and then play again. How can I animate that?

 

var myTimeline:TimelineMax = new TimelineMax();

 

myTimeline.to(this.ballon, 1, {y:-37.65});

myTimeline.to(this.ballon2, 1, {y:-33.65});

myTimeline.to(this.ballon3, 1, {y:-48.05});

 

 

Link to comment
Share on other sites

 

I pasted the required gsap script in my html, and I have the actionscript code below. I would like for the balloons to go to the certain y: coordinate and then reverse and then play again. How can I animate that?
 
var myTimeline:TimelineMax = new TimelineMax();
 
myTimeline.to(this.ballon, 1, {y:-37.65});
myTimeline.to(this.ballon2, 1, {y:-33.65});
myTimeline.to(this.ballon3, 1, {y:-48.05});

 

 

 

To get TimelineMax working in an Animate CC HTML5 Canvas document, it should be:

var myTimeline = new TimelineMax();

not

var myTimeline:TimelineMax = new TimelineMax();

To reverse and replay an animation, just add this to your tweens:

repeat:1, yoyo:true
  • Like 1
Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,

 

if you are writing ActionScript than you should specify the type as you have and add the repeat to the constructor

var myTimeline:TimelineMax = new TimelineMax({repeat:-1, yoyo:true});

With Animate supporting JavaScript and the ActionScript it can be a little confusing. 

For ActionScript help please post in our Flash forum: http://greensock.com/forums/forum/1-flash-actionscript-archive/

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