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

Help with button navigation (ActionScript 3.0)

New Here ,
Oct 18, 2020 Oct 18, 2020

Copy link to clipboard

Copied

I'm new to Animate and I'm having some trouble with my code for a sort of interactive timeline. What happens is that my BACK button will work on the first click but then will not let me click anything else on the screen or won't work at all. I'm using ActionScript and my code is posted below for Frame 1 as the other frames (10, 20, 30, 40, 50) are just "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.
*/

Scott.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
gotoAndStop(20);
}

/* 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.
*/

Ramona.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);

function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void
{
gotoAndStop(30);
}

/* 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.
*/

Steven.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_4);

function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):void
{
gotoAndStop(40);
}

/* 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.
*/

Kim.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
{
gotoAndStop(50);
}

 

I think the issue is that the back button is only set with code on the first frame and that I need to add the back button code to each actionscript frame or just need to copy them and paste them to the appropriate frames. I'm not sure if that's affecting it or anything and I'm not sure what frames to put them on. I've tried 11 and 22 and such but it doesn't work.

 

If anyone would be able to help me go over this and explain it to me simplistically (I'm still very new to this), it would be much appreciated!

TOPICS
ActionScript , Code , How to , Timeline

Views

127

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
community guidelines
Explorer ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

LATEST

Hello sethSCF1.  Let me start by confessing that I haven't read through all of your instructions and code.  I apologize but I have to join a meeting.  However, based on what I did skim through I may know what your problem is.  I had a similar problem when I began working with Flash.  As you suggest you do need to add code for each frame.  However,  you will also need a separate instance of the back button for each frame, and you will need to give each instance a unique name.  Hope that helps.

Votes

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
community guidelines