Jump to content
GreenSock

sali and the kat

Tween till certain label inside a frame to frame animation

Recommended Posts

Good morning, 

 

Im working on a HTML canvas with Animate CC. I have some frame to frame animation movie clips with labels. 

 

Is it possible to use TweenMax  in main timeline, to tween till a certain label inside these movie clips, instead of a frame number like the below example

 

tl.to (mymc, 1, {easel:{frame:25}}

 

Thanks so much. 

 

Ps : Im posting in this forum and not in the GSAP Flash forum cause I m not using As3.  Correct me Im wrong. Thanks so much again. 

Link to comment
Share on other sites

Hello sali and the kat, and Welcome to the GreenSock forum!

You posted in the right place.

 

Please allow us some time so we can look into your question!

 

Thanks!

:)

Link to comment
Share on other sites

EaselPlugin will only accept frame numbers when doing frame tweens.

 

If you want to convert a frame label to a number you can get the MovieClips labels array and loop through it like:

 

  

function getLabelNumber(movieclip, label) {
var labels = movieclip.labels;
for (var i = 0; i < labels.length; i++){
  if(labels[i].label === label) {
            return labels[i].position;    
  } 
}
}


var half = getLabelNumber(this.shapetween_mc, "half"); //29
var end = getLabelNumber(this.shapetween_mc, "end"); //59


var tl = new TimelineLite()


tl.to(this.shapetween_mc, 0.5, {easel:{frame:half}})
  //wait one second and then tween to end
  .to(this.shapetween_mc, 0.5, {easel:{frame:end}}, "+=1");

here is a demo: findFrameLabel.fla.zip

  • Like 3
Link to comment
Share on other sites

Thanks so much!! Im going to try it, adapt it ect... and come back with the results. 

For now, just to say thanks so much for your help and quick response. 

 

 

Sali 

  • Like 1
Link to comment
Share on other sites

Great Answer Carl :)

Link to comment
Share on other sites

We'll drop code into the plugin to accommodate that in the next release. In the mean time, I have attached an updated version here (uncompressed). Better? 

EaselPlugin.js.zip

  • Like 3
Link to comment
Share on other sites

Good morning

great the tool. Its working perfectly. Hope it serves everyone

 

Thanks again for your time&attention, 

 

Sali

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