Error clicking on image

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

Error clicking on image

Post by user#606 »

I am using clickfield() and this works perfectly on a text field.
However I can't find a way of preventing an error if clicked on an image.

on mouseDoubleDown
#if clickfield() not empty then
put field clickfield() into Field "expanded" on card CardExpanded
go to card CardExpanded
#end if

end mouseDoubleDown
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Error clicking on image

Post by Klaus »

Hi user606,

just check the NAME of the target:

Code: Select all

on mouseDoubleDown
   if the name of the target begins with "field" then

      ## Always QUOTE names!
      put field clickfield() into Field "expanded" OF card "CardExpanded"
      go to card "CardExpanded"
   end if 
end mouseDoubleDown
Best

Klaus
user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

Re: Error clicking on image

Post by user#606 »

Thank you again. I hate bothering you/forum, but these pitfalls don't seem to be obvious.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Error clicking on image

Post by Klaus »

Come on, you are really not bothering me and/or the forum! :D
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Error clicking on image

Post by bogs »

It takes a lot to bother Klaus, and the forum in general. Lucky for you they put up with ME first :twisted: so I have smoothed the way for you :wink:
Image
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Error clicking on image

Post by Klaus »

bogs wrote:It takes a lot to bother Klaus, and the forum in general. Lucky for you they put up with ME first :twisted: so I have smoothed the way for you :wink:
:D :D :D
user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

Re: Error clicking on image

Post by user#606 »

Thanks all!
Post Reply