Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Animate Button not working on separate layer

Community Beginner ,
Apr 20, 2025 Apr 20, 2025

Hello! 

 

I am fairly new to Adobe Animate. I have a presentation im working on for an organizational chart. I have buttons navigating throught a website. 

 

In one area, our Org chart, I am trying to make a button that returns to another frame. However, when I click it, it doesnt move. 

 

I have searched the community forums and troubleshooted what I could. I feel like there is something simple im missing and Im hoping someone can point me in the right direction. 


Here is my code snip for this layer/timeline

/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/


this.RCCR_Button5.addEventListener("click", fl_ClickToGoToAndStopAtFrame_22.bind(this));

function fl_ClickToGoToAndStopAtFrame_22()
{
	this.gotoAndStop(0);
}


/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/


this.NVOButton5.addEventListener("click", fl_ClickToGoToAndStopAtFrame_23.bind(this));

function fl_ClickToGoToAndStopAtFrame_23()
{
	this.gotoAndStop(97);
}


/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/


this.SASButton5.addEventListener("click", fl_ClickToGoToAndStopAtFrame_24.bind(this));

function fl_ClickToGoToAndStopAtFrame_24()
{
	this.gotoAndStop(146);

 

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

correct answers 1 Correct answer

Community Expert , Apr 21, 2025 Apr 21, 2025

Thanks.

 

Try moving the code that adds the listeners to the first frame instead.

Translate
Community Expert ,
Apr 20, 2025 Apr 20, 2025

which button's not working?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 20, 2025 Apr 20, 2025

Hello! In the video on the last page I click three buttons. None of them work to bring the slide back to their designated pages and I am unsure why. Let me know if you need any more information, and I am happy to provide anything I can! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2025 Apr 20, 2025

re-enter their instance names in the properties panel

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 20, 2025 Apr 20, 2025

Do they have to be anything specific? The instance name is different than the object name. 

 

instance name.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2025 Apr 20, 2025

the instance name needs to match the name used in code.  the best way to ensure that is to copy from the code and then paste into the instance name field.  make sure there are no spaces copy/pasted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 20, 2025 Apr 20, 2025

I changed the names to match, and then re- did the code. Im afraid that didnt seem to work either. 

 

instancename 2.png

 

 

 

/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/



/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/


this.NVOButton5.addEventListener("click", fl_ClickToGoToAndStopAtFrame_23.bind(this));

function fl_ClickToGoToAndStopAtFrame_23()
{
	this.gotoAndStop(97);
}


/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/


this.SASButton5.addEventListener("click", fl_ClickToGoToAndStopAtFrame_24.bind(this));

function fl_ClickToGoToAndStopAtFrame_24()
{
	this.gotoAndStop(146);
}


/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
2.Frame numbers in EaselJS start at 0 instead of 1
*/


this.Client_RelationsButton.addEventListener("click", fl_ClickToGoToAndStopAtFrame_26.bind(this));

function fl_ClickToGoToAndStopAtFrame_26()
{
	this.gotoAndStop(0);
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2025 Apr 20, 2025

check the developer console for errors.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025

Hi.

 

Are the buttons and code in the main timeline?

 

Please let us know.

 

Regards,

JC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 21, 2025 Apr 21, 2025

I am new, so my Timeline is not super clean im afraid. Which may be my issue. Here is a picture of my timeline. The hilighted button is the one im trying to use, the actions are on frame 193. 

timeline.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025

that's ok.

 

what's the developer console show when you click a button?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 21, 2025 Apr 21, 2025

 

When I actually click a button, nothing changes to the below

 

devoptions.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025

change one button name to xxx in code and in properties panel.

 

test that button 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 21, 2025 Apr 21, 2025

No change 😞 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025

and the button code is on frame 193, correct?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025

Thanks.

 

Which frame is the code for adding event listeners to the buttons is located in?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 21, 2025 Apr 21, 2025

Frame 193 is the frame that both this slide starts on, and the slide for the code actions for the buttons

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025

Thanks.

 

Try moving the code that adds the listeners to the first frame instead.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 21, 2025 Apr 21, 2025

Firstly, thank you so much for your patience in helping me. 

 

I Just want to make sure I am understanding the ask. 

 

My first frame currently has some actions assigned to buttons on that frame. 

The frame 196 has buttons assigned to it, and those buttons have code (all on the same frame). 

 

There are no buttons to code on the first frame on these three slides, save for the actions layer, and THAT layer has its own codes for the layers on that frame. 

 

AdobeAnimateUI.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 21, 2025 Apr 21, 2025

I added the listeners to frame 1 as instructed, and it seems to have broken my HTML preview

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 21, 2025 Apr 21, 2025

I missed a Bracket! 

 

This fixed the issue!! Thank you! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025
LATEST

ie, you can't reference an object in a frame when the object hasn't been created on stage.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 21, 2025 Apr 21, 2025

Awesome!

Glad it worked!

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