Copy link to clipboard
Copied
Hi,
I'm a newbie with Animate CC and JavaScript, so bear with me if I use the wrong terms - I'll try to be as clear as possible.
Let's say we have the following function written on frame 1 of the main canvas:
this.exampleFunction = function (message) {
console.log(message);
}
So I'm happy because I can call this function even when I'm on frame 100. But let's say I create a Symbol Definition - I double click something on my canvas, and I'm brought to this "new layer" where I can edit stuff. From here, I start adding code as well. Everything works, but I can't seem to call the function (exampleFunction) I made on frame 1.
How would I go on about doing this? Let me know if we need more info to tackle this problem!
You can call it in two ways :-
this.parent.exampleFunction('message');
exportRoot.exampleFunction('message'); //exportRoot refers to the main timeline.
Copy link to clipboard
Copied
You can call it in two ways :-
this.parent.exampleFunction('message');
exportRoot.exampleFunction('message'); //exportRoot refers to the main timeline.
Copy link to clipboard
Copied
byunghoona16325993 wrote
I'm a newbie with Animate CC and JavaScript, so bear with me if I use the wrong terms
There is no "main" canvas. There is only one canvas. You mean the main (or "root") timeline.
Going inside a symbol does not access a "new layer", it accesses a new timeline.