Skip to main content
Participant
May 29, 2008
Question

how do I get a replay button to work?

  • May 29, 2008
  • 1 reply
  • 376 views
Hey everybody I can't figure out how to get my relay button to work. The effect that I want is for the timeline to play through and then a replay button appears at the end and on click you can replay the scene.

I have a button called replayBtn with an instance name of replay_btn.

In the actions layer I have this on the last frame-

stop();

function startOver(event:MouseEvent):void {
gotoAndPlay(1);
}

replay_btn.addEventListener(MouseEvent.CLICK, startOver);


But I still cannot get it to work.

Thanks
This topic has been closed for replies.

1 reply

Ned Murphy
Legend
May 29, 2008
Your code looks okay. Try putting a trace in the startOver function to see if your button is getting that far. It's possible there's a mispelling somewhere along the line or some other misnaming. Also make sure you don't have any linkage/class properties assigned to it (right click it in the library).