Page 1 of 1

something wrong with my button logic

Posted: Thu Jan 20, 2011 2:10 am
by bdtrauma
I am using a graphic to allow users to click on different areas of the body to reference a location for clinical findings. I've created a transparent button over the parts of the body and I want to show or hide the label for that part of the body:

on mouseUp
if visible of field "rtarm" is "false" then
show field "rtram"
else
hide field "rtarm"
end if
end mouseUp

This is the simple script I use to show or hide the label when the user clicks on the transparent button. When I run it in the simulator it doesn't work for some reason. I'm sure it is simple logic that I'm not following.

Bert

Re: something wrong with my button logic

Posted: Thu Jan 20, 2011 3:24 am
by RickD
Hi bdtrauma:
I tried your code but I noticed that the field name in the visible line is different than the field names in the subsequent lines and livecode comes back with chuck not found. Try this code... It works under the simulator just fine. Cheers.

on mouseUp
if the visible of field "rtram" is false then
show field "rtram"
else
hide field "rtram"
end if
end mouseUp

Re: something wrong with my button logic

Posted: Thu Jan 20, 2011 5:29 am
by bdtrauma
Thanks Rick... I fixed the fields and also figured out that I wasn't compiling the scripts!

Bert

Re: something wrong with my button logic

Posted: Thu Jan 20, 2011 11:40 am
by Klaus
Bert,

that requires that you put some dollars into the coffee kitty (Kaffekasse) :D


Best

Klaus