Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying the score in 2 fields 1

Status
Not open for further replies.

Flashoid

Technical User
Dec 11, 2002
163
US
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
 
A roulette wheel spins. _root.spin references the dynamic text field labeled "spin". I don't know how to make the number display in both dyn text fields.
 
Wouldn't we want the highscore dyn text field to be included in the coding? The 2 dyn texts are spin and highscore. I tried this but it didn't work:

_root.spin.text = String(highscore.spin);
 
Ya, tough one to code without seeing it in totality. I appreciate your time though.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top