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

Added actions to buttons not working....???

New Here ,
Dec 30, 2016 Dec 30, 2016

Ive created a short movie. I created two buttons, one that skips to the end, the other that lets' the user replay the movie.

I cannot get either button to work, Abode support tells me there is a problem with the script...I'm not a coder, so I'm a bit lost here. I can email the FLA, it's pretty small.

Just in case, here is the script Animate is generating for the buttons:

SKIP BUTTON:

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

*/

button_4.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_8);

function fl_ClickToGoToAndStopAtFrame_8(event:MouseEvent):void

{

    gotoAndStop(70);

}

PLAY BUTTON:

/* Click to Go to Frame and Play

Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and continues playback from that frame.

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.

*/

button_5.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);

function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void

{

    gotoAndPlay(1);

}

My email = mpilla11@gmail.com

907
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

LEGEND , Dec 30, 2016 Dec 30, 2016

In other words, when you use the Code Snippets window, make sure to choose items from the right list. If you're doing HTML5 Canvas, use the HTML5 Canvas snippets, not the ActionScript ones.

Translate
Community Expert ,
Dec 30, 2016 Dec 30, 2016

what's the error message?

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
New Here ,
Dec 30, 2016 Dec 30, 2016

All I know is that it's not working The only error/warning I'm getting is this...

WARNINGS:

Frame numbers in EaselJS start at 0 instead of 1. For example, this affects gotoAndStop and gotoAndPlay calls. (2)

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
LEGEND ,
Dec 30, 2016 Dec 30, 2016

You're trying to use ActionScript code in a Canvas document. No wonder it isn't 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
LEGEND ,
Dec 30, 2016 Dec 30, 2016
LATEST

In other words, when you use the Code Snippets window, make sure to choose items from the right list. If you're doing HTML5 Canvas, use the HTML5 Canvas snippets, not the ActionScript ones.

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