Highlighted

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

New Here ,
May 31, 2020

Copy link to clipboard

Copied

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

Views

324

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

New Here ,
May 31, 2020

Copy link to clipboard

Copied

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

Views

325

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
May 31, 2020

Copy link to clipboard

Copied

Are not working***

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
May 31, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...