Skip to main content
Participant
Nov 2, 2021 6:11 PM UTC
Question

make animation get stop after 15 seconds

hello community i want to make animation on canevas but i have some deficault to do i, i wanna make the L1,L2,MINUTERIE2..... GET off after 15 seconds after click on bp1 or bp2.

 

thanks

 

this.bp1.addEventListener("click",switchf.bind(this));
this.bp2.addEventListener("click",switchf.bind(this));
this.bp3.addEventListener("click",switchf.bind(this));

stage.enableMouseOver(10);
this.on("mouseover",function(){ this.cursor = "pointer"; });

function switchf(e){
if (this.L1.currentLabel == "off" ){
this.L1.gotoAndStop("on");
this.L2.gotoAndStop("on");
this.minuterie1.gotoAndStop("on");
this.minuterie2.gotoAndStop("on");
this.minuterie3.gotoAndStop("on");
} else {
this.L1.gotoAndStop("off");
this.L2.gotoAndStop("off");
this.minuterie1.gotoAndStop("off");
this.minuterie2.gotoAndStop("off");
this.minuterie3.gotoAndStop("off");
}
}
This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Participant
Nov 4, 2021 1:17 PM UTC

There's a much more simple solution, all you need to do is to type this line of code at the frame that reaches the 15 second mark:

 

stop();

 

Translate
kglad
Community Expert
Community Expert
Nov 4, 2021 2:11 PM UTC

that won't work.

Translate
kglad
Community Expert
Community Expert
Nov 3, 2021 3:50 PM UTC

start a ticker loop after clicking, EaselJS v1.0.0 API Documentation : Ticker (createjs.com)

Translate