1

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?

Clif
  • 98
  • 7
  • 1
    I'm not familiar with this framework, but a loud guess would be that `easeType` you have received is not a string, rather a "default" implementation of `toString()` method of some class that's returned when you call `getFrameProperty('easeType'...)`. Thus you can probably inspect that object using whatever docs you might gather on the framework and corresponding class. You may also try using `flash.utils.getQualifiedClassName` to get exact type to verify if the return is not indeed a string, then search for provided class name. – Vesper Mar 03 '22 at 08:42
  • 1
    However if this exact code is not AS3 but rather a JS, there might not be a way to determine the exact type of an object returned, as I've heard JS is largely untyped, yet there should be some way to discern if an object has proerties and output them. – Vesper Mar 03 '22 at 08:44
  • Thanks for your help! I've since found that `getFrameProperty('easeType'...)` doesn't even consistently return `easeType`. Sometimes it returns `undefined`. I have also found an imperfect solution that I think I can make work, which is to export the Animate file as an xfl and scrape the eases from that. There may also be a way to do it through AS3, and I may have to delve into that if this new method doesn't work or becomes too difficult. – Clif Mar 04 '22 at 01:13

0 Answers0