Copy link to clipboard
Copied
So I have two buttons on two different layers and I created each button separately to avoid any double instance issues. I am working in HTML 5 and in my script I have the function for both buttons on the same script frame.
this.stop();
this.path1.addEventListener("click", path1Clicked.bind(this));
function path1Clicked()
{
this.gotoAndPlay(2304);
}
this.path2.addEventListener("click", path2Clicked.bind(this));
function path2Clicked()
{
this.gotoAndPlay(2304);
}
The path2 button works and goes to frame 2304 when I click on it, however. The path1 button does not work and I still can click it as though its a button, but it doesn't goto frame 2304
Hi.
I tested your code and it works.
Please double check your instances names.
Copy link to clipboard
Copied
Hi.
I tested your code and it works.
Please double check your instances names.
Copy link to clipboard
Copied
Thanks, something with the instances. I had to remake the buttons and that might of caused a double instance name somewhere I couldn't find the same name twice in my library, however. Changing path1 to just path fixed the script and now it works.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now