Copy link to clipboard
Copied
Hi there !
I have an HTML project that loads HTML's generated through Animate.
I need a way, from my "container" page, to stop and play the "main timeline" of the Animate generated page. It would be just as if I called the "this.stop()" or "this.play()", but from my container, through Javascript.
I tried a loooot of the "easy" things, including passing as a parameter a function that would call the "this.stop()" from inside the Animate code.
The Animate code easily calls functions from my external Javascript, but I couldn't, for the life of me, call the Animate functions from my JS.
Thanks all !
This has been asked a few times. There's literally no difference between JavaScript coded inside Animate and JavaScript anywhere else in the same HTML document, so all you need is the right object reference. Conveniently, Animate defines a global reference to the root timeline, exportRoot. You can prove its validity by dropping this code in your root timeline:
alert(exportRoot === this);
If you get "true"—which you should—then you're golden. So all you have to do to control the main timeline is:
ex
...Copy link to clipboard
Copied
open your .js file in a text editor and edit it to do what you want.
Copy link to clipboard
Copied
This has been asked a few times. There's literally no difference between JavaScript coded inside Animate and JavaScript anywhere else in the same HTML document, so all you need is the right object reference. Conveniently, Animate defines a global reference to the root timeline, exportRoot. You can prove its validity by dropping this code in your root timeline:
alert(exportRoot === this);
If you get "true"—which you should—then you're golden. So all you have to do to control the main timeline is:
exportRoot.stop();
exportRoot.play();