I'm trying to display a user score in 2 fields at the same time after a user clicks a button.
I have one dynamic text field labeled highscore and another labeled spin.
I have this text in frame 1 in the root timeline:
var counter:Number = 0;
I have a button that has this code in it:
on(press){
ball.spinning = true
ball.spin = 16 + Math.random()*25
ball._rotation = wheel._rotation = 0
_root.highscore += +_root.spin;
counter++;
}
After the user clicks it correctly adds their score to the spin dynamic text field but ONLY adds this score to the highscore field after they click the button a 2nd time. I'd like the score they just got after clicking the button once to display in both dynamic fields (current score in the spin field and add this score to the highscore field).
It correctly adds their new points to the current highscore field but only does so after the user clicks a 2nd time.
thanks
I have one dynamic text field labeled highscore and another labeled spin.
I have this text in frame 1 in the root timeline:
var counter:Number = 0;
I have a button that has this code in it:
on(press){
ball.spinning = true
ball.spin = 16 + Math.random()*25
ball._rotation = wheel._rotation = 0
_root.highscore += +_root.spin;
counter++;
}
After the user clicks it correctly adds their score to the spin dynamic text field but ONLY adds this score to the highscore field after they click the button a 2nd time. I'd like the score they just got after clicking the button once to display in both dynamic fields (current score in the spin field and add this score to the highscore field).
It correctly adds their new points to the current highscore field but only does so after the user clicks a 2nd time.
thanks