Skip to main content
Participant
November 2, 2021
Question

make animation get stop after 15 seconds

  • November 2, 2021
  • 2 replies
  • 259 views

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 has been closed for replies.

2 replies

Participant
November 4, 2021

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();

 

kglad
Community Expert
Community Expert
November 4, 2021

that won't work.

kglad
Community Expert
Community Expert
November 3, 2021