text field woes...this should be easy

Ok, for some reason I can’t get the text fields to say what I want them to say. I have checked the names of them all like a million times to make sure they are right and I have made sure that all the appropriate things are checked off in IB

property playerscore : 0
property cpuscore : 0
property playerscoretext : "You: "
property cpuscoretext : "Computer: "
tell window "mainWindow"
	set the contents of text field "player_score" to playerscoretext & playerscore
	set the contents of text field "cpu_score" to cpuscoretext & cpuscore
end tell

Where is this code being executed at, and when do the properties get set?

Hi hendo,

the syntax of the above lines looks correct - when you’re sure about the names the only thing I can imagine, that you placed the ‘set the contents…’-lines somewhere where they are not executed. Maybe you can test this with ‘log’:


property playerscore : 0
property cpuscore : 0
property playerscoretext : "You: "
property cpuscoretext : "Computer: "

on ...
	log (playerscoretext & playerscore)
	log (cpuscoretext & cpuscore)
	tell window "main"
		set the contents of text field "player_score" to playerscoretext & playerscore
		set the contents of text field "cpu_score" to cpuscoretext & cpuscore
	end tell
end on

If you don’t see any output in the Run Log window then the lines simple haven’t been been executed …

D.

Edit: Sry, Bruce types faster than me :wink:

it’s ok, I got it to work…it was been executed in the wrong place