Highlighted

multiple buttons not working in Adobe Animate HTML5 Canvas doc

Community Beginner ,
Jan 17, 2019

Copy link to clipboard

Copied

I'm having trouble with multiple buttons (all with unique instance names) working. Some do but when I have an arrow cycling through some content, the first one works, then the subsequent ones don't. I'm using this code for each button and changing the instance name and function name each time. Other buttons work in layout but where they are replaced with another in the same spot, it doesn't work. Any idea how to fix?

this.Next2_btn.addEventListener("click", fl_ClickToGoToAndPlayFromFrame_44.bind(this));

function fl_ClickToGoToAndPlayFromFrame_44()

{

this.gotoAndStop(1);

}

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

If you're just swapping out one button for an identical button, then... why? Why not remove and replace the event listeners instead?

Views

135

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

multiple buttons not working in Adobe Animate HTML5 Canvas doc

Community Beginner ,
Jan 17, 2019

Copy link to clipboard

Copied

I'm having trouble with multiple buttons (all with unique instance names) working. Some do but when I have an arrow cycling through some content, the first one works, then the subsequent ones don't. I'm using this code for each button and changing the instance name and function name each time. Other buttons work in layout but where they are replaced with another in the same spot, it doesn't work. Any idea how to fix?

this.Next2_btn.addEventListener("click", fl_ClickToGoToAndPlayFromFrame_44.bind(this));

function fl_ClickToGoToAndPlayFromFrame_44()

{

this.gotoAndStop(1);

}

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

If you're just swapping out one button for an identical button, then... why? Why not remove and replace the event listeners instead?

Views

136

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 17, 2019 0
Adobe Community Professional ,
Jan 17, 2019

Copy link to clipboard

Copied

Open your browser dev console and check for errors.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 17, 2019 0
Community Beginner ,
Jan 17, 2019

Copy link to clipboard

Copied

doesn't seem to be any, is there any reason different buttons with different instance names shouldn't click to frame numbers? Sooo frustrating. Other btns work ok, it's the ones in the same spot that replace eachother (arrowing through page content, for instance) that do it...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 17, 2019 0
Adobe Community Professional ,
Jan 17, 2019

Copy link to clipboard

Copied

If you're just swapping out one button for an identical button, then... why? Why not remove and replace the event listeners instead?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 17, 2019 1