How to access the function in js file which is written in Animate CC time line
Animate CC Timeline Function
this.testFunction = function () {
console.log("welcome to CC");
}
How to access "testFunction" in js file
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 JavaScript:
exportRoot.myMovieClip.testFunction();
etc...
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.