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

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

New Here ,
May 31, 2020 May 31, 2020

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;
}

TOPICS
How to
431
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 ,
May 31, 2020 May 31, 2020

Are not 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 ,
May 31, 2020 May 31, 2020
LATEST

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

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