Copy link to clipboard
Copied
I simply want to place event listeners in the Animate CC global script so that I am not cluttering up frame 1. How would I put the following script in the global script window and change it so the listener can actually find the instance "nextBut" at the root level? Thanks in advance.
this.nextBut.addEventListener("click", doNext.bind(this));
function doNext() {
alert("foo")
}
It's probably a bad idea to put bare code in the global script. If you have initialization code that needs to be run, wrap it in an init function and then call it in the first frame.
Or just "clutter up" frame 1. Animate doesn't care. Worry about what works, not IDE aesthetics.
Copy link to clipboard
Copied
It's probably a bad idea to put bare code in the global script. If you have initialization code that needs to be run, wrap it in an init function and then call it in the first frame.
Or just "clutter up" frame 1. Animate doesn't care. Worry about what works, not IDE aesthetics.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now