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

why the function repeat

Explorer ,
Jan 07, 2021 Jan 07, 2021

Copy link to clipboard

Copied

i wote function in frame 2 the gotoAndPlay (3)

when i returen from frame 3 to frame 2 goandPlay(2)

and run function. the function run twies.

do you know why or this is abug? 

 

 

Views

154

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
community guidelines
LEGEND ,
Jan 07, 2021 Jan 07, 2021

Copy link to clipboard

Copied

You're expecting us to debug your code with nothing but vague explanations of what it's doing?

Votes

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
community guidelines
Explorer ,
Jan 09, 2021 Jan 09, 2021

Copy link to clipboard

Copied

LATEST

sorry

in this link you can see asample of counting 

http://hebrewgames.org/test/test1.html

 

when click + or _ it is counting ok

when click NEXT PAGE

and the click PREVPAGE

when click + or _ it is counting not ok

 

code:

frame 0:

this.stop();

this.counter=0;

 

this.plus_bt.addEventListener("click", countUp.bind(this));

function countUp()
{
this.counter= this.counter+1;
this.countTx.text=this.counter;
}

 

this.minus_bt.addEventListener("click", countDown.bind(this));

function countDown()
{
this.counter= this.counter-1;
if (this.counter<0){this.counter=0}
this.countTx.text=this.counter;
}

this.nextPage_bt.addEventListener("click", nextP.bind(this));

function nextP()
{
this.gotoAndPlay(1);
}


this.prevPage_bt.addEventListener("click", prevP.bind(this));

function prevP()
{
this.gotoAndPlay(0);
}

 

 

frame1:

this.stop();

 

Votes

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
community guidelines