mouseUp event on mobile

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

mouseUp event on mobile

Post by SteveTX » Wed Jul 03, 2013 11:14 pm

I have actions for a field object based on event mouseUp. This works in the IDE, but not on mobile environment. Is there a different event that should be used for mobile environments?

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: mouseUp event on mobile

Post by Mag » Wed Jul 03, 2013 11:38 pm

If you don't need multitouch but just single touch, I thing that you could use mouseUp, mouseDown, mouseMove and so on.. can you post the code that don't works, maybe depends on the properties of the field? Is it editable?

PS
Search for touch in the dictionary for mobile specific interactions

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: mouseUp event on mobile

Post by SteveTX » Wed Jul 03, 2013 11:48 pm

found the issue. i am creating the images on the fly, and the object script disappears upon destroy/resize. now to figure out how to programatically add event code to object scripts...

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Re: mouseUp event on mobile

Post by malte » Thu Jul 04, 2013 12:06 am

Hi Steve,

most of the time it is not necessary to set a script at runtime.

You could either use the messagePath and put your mouseUp script at (for example) card level:

in the card script:

on mouseUp
-- check if an image has been touched
if word 1 of the name of the target is "image" then
-- do stuff
end if
end mouseUp

or (more elegantly) set a behavior. Script needs to be in a button. Then on creation of the image set the behavior of image "theImage" to the long ID of button "theBehavior"

Hope that helps,

Malte

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: mouseUp event on mobile

Post by SteveTX » Thu Jul 04, 2013 8:13 am

Very helpful indeed!

Post Reply