Skip to main content
Participant
Sep 3, 2021 10:53 AM UTC
Question

Navigate timline using multiple buttons

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 is closed to new replies. Start a new post to keep the conversation going.

7 replies

JoãoCésar17023019
Community Expert
Community Expert
Sep 3, 2021 11:51 AM UTC

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

Translate
Khloe5C3EAuthor
Participant
Sep 3, 2021 12:35 PM UTC

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 🙂

Translate
JoãoCésar17023019
Community Expert
Community Expert
Sep 3, 2021 1:01 PM UTC

Thanks for the info.

 

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

Translate