Skip to main content
Participant
September 3, 2021
Question

Navigate timline using multiple buttons

  • September 3, 2021
  • 1 reply
  • 268 views

I'm doing a project for uni and I'm a beginner to Adobe Animate. 

I'm trying to create a simple interactive HTML doc. Using buttons to navigate a timeline I create.

My problem is the I have chosen to include multiple buttons in order to other parts of the timeline but none of them work upon clicking. My other standalone buttons work just not the multiple.

This is the actionscript I used could someone please help and suggest a solution :))

 

/* Stop at This Frame
The  timeline will stop/pause at the frame where you insert this code.
Can also be used to stop/pause the timeline of movieclips.
*/

this.stop();


/* 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.bankst_button.addEventListener("click", fl_ClickToGoToAndStopAtFrame_320.bind(this));

function fl_ClickToGoToAndStopAtFrame_320()
{
	this.gotoAndStop(320);
}

this.ludlowst_button.addEventListener("click", fl_ClickToGoToAndStopAtFrame_360.bind(this));

function fl_ClickToGoToAndStopAtFrame_360()
{
	this.gotoAndStop(360);
}

this.greenptav_button.addEventListener("click", fl_ClickToGoToAndStopAtFrame_400.bind(this));

function fl_ClickToGoToAndStopAtFrame_400()
{
	this.gotoAndStop(400);
}

this.ssmreturn_button.addEventListener("click", fl_ClickToGoToAndStopAtFrame_180.bind(this));

function fl_ClickToGoToAndStopAtFrame_180()
{
	this.gotoAndStop(180);
}

 

This topic has been closed for replies.

1 reply

JoãoCésar17023019
Community Expert
Community Expert
September 3, 2021

Hi.

 

Your code seems to be correct.

 

Please double-check if the buttons exist, if they have a very well defined hit area, and if the destination frames also exist and let us know.

 

Regards,

JC

Khloe5C3EAuthor
Participant
September 3, 2021

Yes in the button timeline I have added an image to define each state however the 'down' and 'hit' state are the same. I did this for my first button at the beginning of the timeline and it works fine. Could the problem also be because of this output warning? "Content with both Bitmaps and Buttons may generate local security errors in some browsers if run from the local file system."

 

Also I do not know what destination frames mean

Thanks for your help 🙂

JoãoCésar17023019
Community Expert
Community Expert
September 3, 2021

Thanks for the info.

 

Does this issue happen if you try to run the HTML file by double-clicking on it outside of Animate?