Animate - problem with duplicating scripts after loop


hi all,

 

i have problem simple button script @ first frame. fine when timeline playing first time. after when timeline loops , stop again @ 0 frame button script fireing 2 times, when loops third time fireing 3 times etc...

 

here script:

 

this.stop();

exportroot.mc_cta.cursor = "pointer";

 

this.mc_cta.on("click", clickfunc.bind(this));

 

function clickfunc() {

    console.log("clicked");

    eb.useractioncounter("clicked");

    exportroot.gotoandplay(1);

}

 

anybody ideas? wrong?

 

thanks!

kris

use:

 

this.stop();

exportroot.mc_cta.cursor = "pointer";

 

if(!this.alreadyexecuted){

this.alreadyexecuted=true;

this.mc_cta.on("click", clickfunc.bind(this));

 

function clickfunc() {

console.log("clicked");

eb.useractioncounter("clicked");

exportroot.gotoandplay(1);

}

}



More discussions in Adobe Animate CC - General


adobe

Comments

  1. The merit casino no deposit bonus codes
    No Deposit Bonus Codes at Merger Casino. Learn how to get started using the latest bonuses 제왕 카지노 and the new member bonus codes. Best 메리트카지노총판 Free Spins 메리트 카지노 in

    ReplyDelete

Post a Comment

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?