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

Can you set variables to buttons to control the timeline

Community Beginner ,
May 15, 2018 May 15, 2018

Hi All

It has been a very long time since I have developed in Flash... now Animate.

I am working my way around the new software but have a question...

I was wondering if I can add a variable to a button to control the timeline.

What I want to do is have, say, 4 buttons on a frame... then when one of the buttons is selected it goes to the next frame for general info and then it moves to one of 4 other frames.

What I am thinking is something like:

  • Frame 1 - 4 buttons
    • Button 1 - linked to frame 2 to redirect to frame 3
    • Button 2 - linked to frame 2 to redirect to frame 4
    • Button 3 - linked to frame 2 to redirect to frame 5
    • Button 4 - linked to frame 2 to redirect to frame 6
  • Frame 2 - general information that shows for a while and then skips to the correct frame depending on the button that was selected.

Is this possible?

If so can you help me with the code I need or point me in the right direction for a tutorial etc.

Thanks for your help in advance.

368
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 , May 15, 2018 May 15, 2018

Hi.

It is.

Basically:

- You store the final frame you want to go in a variable when the user clicks on one of the buttons;

- Set a timeout on the second frame to hold the amount of time you want;

- Then, after the timeout, you send the timeline to the final frame.

As I don't know which type of document you are working on, I created two similar examples in AS3 and JavaScript. Notice that I'm using the buttons names to get the final frames.

FLA download (HTML5 (Canvas)):

animate_cc_html5_button_navigation.zip - Google Drive

...
Translate
Community Expert ,
May 15, 2018 May 15, 2018

Hi.

It is.

Basically:

- You store the final frame you want to go in a variable when the user clicks on one of the buttons;

- Set a timeout on the second frame to hold the amount of time you want;

- Then, after the timeout, you send the timeline to the final frame.

As I don't know which type of document you are working on, I created two similar examples in AS3 and JavaScript. Notice that I'm using the buttons names to get the final frames.

FLA download (HTML5 (Canvas)):

animate_cc_html5_button_navigation.zip - Google Drive

FLA download (AS3):

animate_cc_as3_button_navigation.zip - Google Drive

I hope it helps.

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 ,
May 16, 2018 May 16, 2018
LATEST

Thank you so much... from your example I should be able to work it out.

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