Problem: I am trying to make a slider button. Is there any way to retrieve the number of the current frame in a symbol timeline and store it in a variable? I intend to make a symbol timeline of say, 100 frames, and move a shape along a linear motion path. Where the shape rests will be the percentage value of the slider, which I need to store in a variable. Is there a way to do this? I’ve looked at the Javascript API and couldn’t see anything that might help. Or is there a simpler solution?!
There’s no frame concept in Saola Animate.
However, you can get and set timeline timestamp.
// main timeline of the main document
var mainTimeline = doc.getTimeline();
// document in a symbol
var symbolDoc = doc.getElement('symbol element name').getSymbolDoc();
// main timeline in a symbol
var symbolMainTimeline = symbolDoc.getTimeline();
// get a timeline timestamp, e.g. mainTimeline
var time = mainTimeline.getTimestamp();
// pause a timeline at a time
mainTimeline.pause(time);
// play a timeline from a time
mainTimeline.play(time);
You can take a look at Control animations sample in Samples tab in welcome screen.
Maybe, it’s similar to what you’re trying to do.