Jump to content
Search Community

Animate frames shapes in EaselJS with TweenLite

RosaGS
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

Posted

Hi there!

 

I have many shapes in EaselJS -not spritesheet, only shapes- (shape_1, shape_2, ..., shape_n) which are different frames of the same object and I want to animate them with TweenLite to display all the frames (1,2,3,4,...), like an animated movieclip in flash.

 

 

I have seen that with CreateJS TweenJS works this code:

this.timeline.addTween(createjs.Tween.get({}).to({state:[{t:this.shape0}]}).to({state:[{t:this.shape1}]},1).to({state:[{t:this.shape2}]},1).to({state:[{t:this.shape3}]},1).to({state:[{t:this.shape4}]},1).wait(1));

to display sequencially all the shapes...

 

Is there any equivalent in TweenLite?

 

Best Regards

 

Rosa

Posted

Hi and welcome to the GreenSock forums,

 

Unfortunately I am not familiar enough with the EaselJS API to understand what that code does. I tried looking for some documentation on "state" but came up short. From the code you provided I do not know what state, t, or shape0 are. 

 

It would really help if you could provide a super simple CodePen demo that shows what that code does: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

TweenLite can animate any numeric property of any JavaScript object so it naturally handles most easelJS properties without any special plugins or tricks. I just don't know enough about what you are doing to provide decent help.

 

if you just need to tween through frames of a MovieClip, you can probably tween a value of a generic object and then pass that value to gotoAndStop() using an onUpdate callback. Again, if you provide a very simple example it will be much easier for us to help.

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