Skip to main content
Participant
May 31, 2020
Question

Play/Pause/Stop buttons are working? how do i make this code work

  • May 31, 2020
  • 2 replies
  • 461 views

Hey, Everyone

so im attempting to make a simple animation with interactive controls to play pause and stop the animation.

but i cant seem to get the code i have here to work effectively on my project?

Any help would be appreciated

 

this.stop()
console.log(this)
var isPlaying = false;
var stageHeight = stage.canvas.height;
var stageWidth = stage.canvas.width;

this.playBtn.addEventListener("click", playClicked.bind(this));
function playClicked(){
this.play();
isPlaying = true;
}
this.pauseBtn.addEventListener("click", pauseClicked.bind(this));
function pauseClicked() {
this.stop();
isPlaying = false;
}
this.stopBtn.addEventListener("click", stopClicked.bind(this));
function stopClicked() {
this.gotoAndStop("BeginPoint");
isPlaying = false;
}

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Colin Holgate
Inspiring
May 31, 2020

Your script works in my FLA, which suggests your symbols or frame are not named like you have them in the script.

CoatlicueAuthor
Participant
May 31, 2020

Are not working***