something wrong with my button logic

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bdtrauma
Posts: 34
Joined: Fri Dec 24, 2010 11:37 pm

something wrong with my button logic

Post by bdtrauma » Thu Jan 20, 2011 2:10 am

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

RickD
Posts: 31
Joined: Thu Feb 11, 2010 5:47 pm

Re: something wrong with my button logic

Post by RickD » Thu Jan 20, 2011 3:24 am

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

bdtrauma
Posts: 34
Joined: Fri Dec 24, 2010 11:37 pm

Re: something wrong with my button logic

Post by bdtrauma » Thu Jan 20, 2011 5:29 am

Thanks Rick... I fixed the fields and also figured out that I wasn't compiling the scripts!

Bert

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: something wrong with my button logic

Post by Klaus » Thu Jan 20, 2011 11:40 am

Bert,

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


Best

Klaus

Post Reply

Return to “iOS Deployment”