checkbox help for beginners

i made this small rollout to test
how i can make an action base on a checkbox.
my goal is to press the button and max will print
"yes" if the checkbox is checked
or "no" if its not.
i keep getting "no"...
what have i miss?

try(destroyDialog rlt_boxer)catch()
global rlt_boxer

rollout rlt_boxer "boxer"
(
button btntest "Test" across:1
checkbox myCheckBox "myCheckBox" across:1

on btntest pressed do --print yes if checkbox is true or no if false
(
if myCheckBox == true then
(
print "yes"
)
else
(
print "no"
)
) --end of btntest

on myCheckBox changed theState do
(
print ("myCheckBox-" + theState as string) -- print the state on mycheckbox
) -- end od checkbox
) -- end of rollout

createDialog rlt_boxer 150 50

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dellor's picture

thanks:)

thanks:)

barigazy's picture

...

Also to post properly your code next time see this post
http://www.scriptspot.com/forums/3ds-max/general-scripting/kredka-strike...

bga

barigazy's picture

...

Simply use this

try(destroydialog ::rlt_boxer)catch()
rollout rlt_boxer "boxer"
(
	button btntest "Test" across:1
	checkbox myCheckBox "myCheckBox" across:1
	on btntest pressed do
	(
		print (if myCheckBox.checked then "yes" else "no")
	)
	on myCheckBox changed theState do
	(
		print ("myCheckBox-" + theState as string)
	)
)
createDialog rlt_boxer 150 50

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.