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

Please help - can't get animate canvas stop button to work

New Here ,
Mar 20, 2018 Mar 20, 2018

I don't understand javascript - I needed to produce a simple animation in animate cc output to html 5 canvas.

I have liberated, then bodged this code from a forum.

The animation behaves itself by pausing at being, when I press the play button, it plays, it reverses when I press reverse button, and it stops at the end. Which is all super. But I cannot work out what to put to make it stop/pause when I press my stop button - I have removed the bits that don't work.

this.stopButton.addEventListener("click", fl_MouseClickHandler_7.bind(this));

function fl_MouseClickHandler_7()

{

this.Stop();

}

from code snippets doesn't work.

Can anyone help?

Thanks in anticipation

debra

this.stop();

this.playButton.addEventListener("click", playForwards.bind(this));

function playForwards() {

if (createjs.Ticker.hasEventListener("tick")) {

createjs.Ticker.removeAllEventListeners();

}

createjs.Ticker.addEventListener("tick", playF.bind(this));

}

function playF(e) {

this.gotoAndStop(this.currentFrame + 1);

if ((this.currentFrame == 155)) {

createjs.Ticker.removeAllEventListeners();

}

stage.update();

}

this.reverseplayButton.addEventListener("click", playReverse.bind(this));

function playReverse() {

if (createjs.Ticker.hasEventListener("tick")) {

createjs.Ticker.removeAllEventListeners();

}

createjs.Ticker.addEventListener("tick", playR.bind(this));

}

function playR(e) {

this.gotoAndStop(this.currentFrame - 1);

if ((this.currentFrame == 155)) {

createjs.Ticker.removeAllEventListeners();

}

stage.update();

}

501
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

correct answers 1 Correct answer

Community Expert , Mar 20, 2018 Mar 20, 2018

this.Stop();

should be this.stop();

ie, case-counts.

Translate
Community Expert ,
Mar 20, 2018 Mar 20, 2018

this.Stop();

should be this.stop();

ie, case-counts.

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 ,
Mar 20, 2018 Mar 20, 2018
LATEST

When something isn't working, always, always, always check the developer console for error messages.

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