Hello.
I need to be able to target the timeline with JS from a button. I am trying gotoAndStop(3); but this doesn’t seem to be working?
Specifically I have this old Hippani random generating code I am tryng to translate to Saola Animate:
There’s no gotoAndStop function and frame concept in Saola Animate.
In Saola Animate, you need to use doc.getTimeline('Timeline name') to get the timeline.
After that, use play, pause methods of the timeline to control it.
You can enable Show API option in the script editor to see APIs that Saola Animate supports:
Hi Toan Le.
Thank you for the example. It helps a lot. I am just worried that “Pause” will only pause a “Playing” timeline? Specifically I need the command to “jump” to a specific timeframe without it playing from frame 0 and just “Stop” there to display an image?
Hey ToanLS.
I decided to use scenes instead of frames as a work around and found this code here on the forum BUT it is not jumping to the sceneTime 2 (2 seconds) in Scene_2 for some reason? It is just going to Scene_2 and playing from frame 0.
sceneTime: '2' option will go to the label ‘2’ in the timeline if any.
To go to 2 seconds, you can use sceneTime: 2000 (Saola Animate use milliseconds).
Timeline name is a string/text, and any text should be in 'single quotes' or "double quotes".
It’s likely that you missed the opening quote before Timeline_1.
Ahh…yes I see . Thanks again ToanLS.
I am nearly there…just getting a final parsing error with this code I am trying to implement from Hippani for a random Image Generator: I don’t know why it is not working?
EDIT:
it’s all good. It’s working Just needed another curly bracket at the end.
Thank you all for the responses. You all helped and I am extremely thankfull
Cheers
Deek