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

how do i reset my point to zero?

Community Beginner ,
Dec 17, 2018 Dec 17, 2018

Copy link to clipboard

Copied

hi, how do i reset the point once i goes back to frame 1?

var total:int = 0

totaltext.text = total.toString();

mederma1.addEventListener(MouseEvent.MOUSE_UP, poin)

function poin(event:MouseEvent):void

{

total = total + 25;

totaltext.text=total.toString();

}

Views

157

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
Advocate ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

LATEST

Hi arisud

I'm not getting that. In your code snippet is nothing that explains how you go back to frame 1. Are you looping through a number of frames and the playhead hits repeatedly frame 1?

All I can see here is that on each MOUSE_UP on mederma1  your var total gets increased by the number of 25 and that is put into your textfield totalText. (25, 50, 75 .. so what?) Just however it reaches frame 1 put there total = 0;

Or do i do not see something obvious?

klaus

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