Copy link to clipboard
Copied
Animate CC Timeline Function
this.testFunction = function () {
console.log("welcome to CC");
}
How to access "testFunction" in js file
Man, someone is marking correct answers on autopilot today.
To access any code written inside Animate from outside Animate, use the exportRoot object. This global object is automatically defined by Animate, and points to the root timeline level. So if you defined testFunction on the root timeline, you'd access it from anywhere else on the same HTML page with:
exportRoot.testFunction();
And if the function is inside a movieclip, you'd name the movieclip and extend the reference as per usual for Java
...Copy link to clipboard
Copied
open your js file in a text editor.
Copy link to clipboard
Copied
Man, someone is marking correct answers on autopilot today.
To access any code written inside Animate from outside Animate, use the exportRoot object. This global object is automatically defined by Animate, and points to the root timeline level. So if you defined testFunction on the root timeline, you'd access it from anywhere else on the same HTML page with:
exportRoot.testFunction();
And if the function is inside a movieclip, you'd name the movieclip and extend the reference as per usual for JavaScript:
exportRoot.myMovieClip.testFunction();
etc...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now