Highlighted

4 buttons and 4 different texts

New Here ,
Mar 04, 2020

Copy link to clipboard

Copied

Hi!

I'm kind of new to Animate and I'm struggling to do something that I imagine is very simple for you. I have a list of 4 buttons that when I click it was to open a different text for each button, but when I click on a button it goes to the frame and doesn't open anything else. It gets "stuck" on that frame and the other buttons don't work. Help...

 

Oh! I'm using a HTML5 canvas.

TOPICS
ActionScript, Code, How to, Other

Views

119

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

4 buttons and 4 different texts

New Here ,
Mar 04, 2020

Copy link to clipboard

Copied

Hi!

I'm kind of new to Animate and I'm struggling to do something that I imagine is very simple for you. I have a list of 4 buttons that when I click it was to open a different text for each button, but when I click on a button it goes to the frame and doesn't open anything else. It gets "stuck" on that frame and the other buttons don't work. Help...

 

Oh! I'm using a HTML5 canvas.

TOPICS
ActionScript, Code, How to, Other

Views

120

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
Mar 04, 2020 0
Enthusiast ,
Mar 07, 2020

Copy link to clipboard

Copied

Here is one solution. Put the message for each button in a separate layer that displays when the timeline goes to a designated frame (identified with a label). Create an on click event listener for each button that calls a function to advance to the labeled frame. The code is in frame 1 of a layer named Actions and reads:

this.stop();

this.button1.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this, "Page1"));
this.button2.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this, "Page2"));
this.button3.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this, "Page3"));
this.button4.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this, "Page4"));


function fl_ClickToGoToAndStopAtFrame(t){
this.gotoAndStop(t);
}

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...
Mar 07, 2020 0