Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
what's the error message?
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
You're trying to use ActionScript code in a Canvas document. No wonder it isn't working.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now