Detecting Image Name On mouseUp

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Detecting Image Name On mouseUp

Post by Googie85 » Sun Jul 21, 2019 4:31 am

Hi Guys!!

I am trying to get the name of an image when mouseUp is generated. Any ideas would be appreciated!!!!

Many Thanks,

Googie.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9356
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Detecting Image Name On mouseUp

Post by richmond62 » Sun Jul 21, 2019 9:14 am

That's all going to be a bit tedious as the obvious way to effect that
is by having code in the scriptEditor of each image;

Code: Select all

on mouseUp
put the short name of me
end mouseUp

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

Re: Detecting Image Name On mouseUp

Post by bogs » Sun Jul 21, 2019 10:29 am

Well, you could also just use the target in the card or stack level script, with the mouseDown or Up event -

Code: Select all

local myLocalVar --< this variable is outside of any handler,
-- and so is available to all handlers from here to the end
-- of the page

on mouseDown
	put the name of the target into myLocalVar
end mouseDown

on mouseUp
	if word 1 of myLocalVar = "image" then  ...-- your code for when an image is clicked...
end mouseUp
Image

Post Reply

Return to “Android Deployment”