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

run trace() just once within an enter frame function?

Participant ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

I have an enter frame event and a function running that event, I have place a trace statement within the function and the stage is running at 25fps.

My problem is how do you make the trace statement run just once only? Since it get really annoying when the output panel keep tracing the same thing and slow down my swf....

Thanks in advance

TOPICS
ActionScript

Views

1.1K

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

correct answers 1 Correct answer

Community Expert , Dec 22, 2011 Dec 22, 2011

//outside your function

var alreadyDone:Boolean

//inside your listener function

if(!alreadyDone){

alreadyDone=true;

trace(...);

}

Votes

Translate

Translate
Community Expert ,
Dec 22, 2011 Dec 22, 2011

Copy link to clipboard

Copied

//outside your function

var alreadyDone:Boolean

//inside your listener function

if(!alreadyDone){

alreadyDone=true;

trace(...);

}

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
Participant ,
Dec 23, 2011 Dec 23, 2011

Copy link to clipboard

Copied

Thanks

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
Community Expert ,
Dec 23, 2011 Dec 23, 2011

Copy link to clipboard

Copied

LATEST

you're welcome.

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