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
Location: Alderney, Channel Islands
Contact:

Error clicking on image

Post by user#606 » Sun Aug 20, 2017 2:18 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Error clicking on image

Post by Klaus » Sun Aug 20, 2017 2:25 pm

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
Location: Alderney, Channel Islands
Contact:

Re: Error clicking on image

Post by user#606 » Sun Aug 20, 2017 3:36 pm

Thank you again. I hate bothering you/forum, but these pitfalls don't seem to be obvious.

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

Re: Error clicking on image

Post by Klaus » Sun Aug 20, 2017 3:43 pm

Come on, you are really not bothering me and/or the forum! :D

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Error clicking on image

Post by bogs » Sun Aug 20, 2017 5:32 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Error clicking on image

Post by Klaus » Sun Aug 20, 2017 5:58 pm

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
Location: Alderney, Channel Islands
Contact:

Re: Error clicking on image

Post by user#606 » Mon Aug 21, 2017 2:39 pm

Thanks all!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”