Skip to main content
Participant
December 30, 2016
Answered

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

  • December 30, 2016
  • 1 reply
  • 991 views

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

    This topic has been closed for replies.
    Correct answer Colin Holgate

    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.

    1 reply

    kglad
    Community Expert
    Community Expert
    December 30, 2016

    what's the error message?

    pillaCMAuthor
    Participant
    December 31, 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)

    Legend
    December 31, 2016

    You're trying to use ActionScript code in a Canvas document. No wonder it isn't working.