• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

JSFL: Is it possible to get the ease used for a tween?

Community Beginner ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

I am attempting to make a mini animation engine using a texture atlas exported from Animate, then using GSAP to perform the animations in my game. However, I find the frame by frame JSON that is exported from Animate to be too large and unwieldy. Since GSAP uses a lot of the same ease interpolations as Animate, I was hoping to be able to read these eases from the frame data. I have yet to figure out a way to do this.

It is easy to set the ease of a tween using something like:

 

an.getDocumentDOM().getTimeline().setFrameProperty("easeType", 5, 4, 0);

 

In order to read an ease, I've attempted to use:

 

var easeType = an.getDocumentDOM().getTimeline().getFrameProperty("easeType", 0, 9);
fl.trace(easeType);

 

Where '0' and '9' are the first and last frame of my tween. This only returns a very unhelpful string of "easeType". Using "frame.getCustomEase()" also doesn't appear to be what I need.

Is there some way of accessing this information?

TOPICS
Exchange extensions , How to

Views

362

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

The JSFL documentation hasn't been updated in almost a decade, so it has nothing about ease formulas, which were only added about five years ago. It's possible the API doesn't even expose this information. JSFL seems to be a very low priority for the Animate team these days.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

So I haven't found a way to do this through JSFL, but I did find that you can save your Animate file as a .xfl file, then use this file to scrape the eases from. I'll probably just end up making my own texture atlas straight from this file eventually. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

Not sure I'm even being remotely helpful but the Motion Tween engine allows you to double click the span, create a custom ease and then save it as a preset. There's got to be an XFL file locally that stores all this that could be opened and scavenged...
Screen Shot 2022-03-10 at 3.18.07 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 10, 2022 Mar 10, 2022

Copy link to clipboard

Copied

LATEST

I do appreciate you looking into it and trying to think of alternative solutions. While that is interesting, I also did some tests comparing the eases that Animate uses to the ease functions at easings.net and found that they (the couple that I tested at least) appear to use the exact same functions, or produce the exact same results at least. So I already went ahead and implemented those into my engine. 

Unless I'm misunderstanding why I would want to do this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines