mouseDown not good for mobile platform

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
kroghet
Posts: 5
Joined: Sat Feb 18, 2012 10:53 pm

mouseDown not good for mobile platform

Post by kroghet » Sun Feb 26, 2012 3:18 pm

Hey I am trying to make a simple side-scroller game. And I have two arrow btn's to move my Player from side to side.

But I can't figure out to make it so when the btn is down, the Player moves, and stop when btn is up. I have use mouseDown and mouseUp. But when I press the right arrow, and slide my finger out of the btn, the Player keeps moving, because there is no mouseUp on the btn.

So my question is how do you fix this on mobile platforms, any way to make the game know if I slide out from my btn, and then stop moving?

Thx a lot

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: mouseDown not good for mobile platform

Post by bn » Sun Feb 26, 2012 5:27 pm

Hi Kroghet,

try mouseRelease

mouseRelease is sent to an object when the pointer or finger is released but outside of the boundaries of the original object.

e.g.

Code: Select all

on mouseRelease
  mouseUp
end mouseRelease
this assumes that your code in mouseUp is what you want to do.

Kind regards

Bernd

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: mouseDown not good for mobile platform

Post by Dixie » Sun Feb 26, 2012 5:57 pm

Kroghet...

'mouse down not good for mobile platform' !... What sort of title is this to give a posting in the forum ?... It is very misleading !... As it has just been pointed out to you it really depends on how you use commands within liveCode, in this case the 'mouseDown' command... As you can now see there is nothing wrong with using this command.... RTFM springs to mind with the emphasis on the adjective contained within this acronym...

Dixie

kroghet
Posts: 5
Joined: Sat Feb 18, 2012 10:53 pm

Re: mouseDown not good for mobile platform

Post by kroghet » Sun Feb 26, 2012 7:21 pm

Hey bn, thx for the help. I will try and see if I can make that work. The tutorials I found on this site, used the mouseUp or mouseDown, so I could not figure out how to make it work in my context.
Thx for the help :)

And to Dixie, I am very sorry to have ruined your day, and your awesome Livecode skills. And as you can see, I am very new to this, and have been following some tutorials, but no one with information that fixed my problem. Hopefully no one else will have the same problem like me. If I see any then I will make sure to send them your way so you can help them.

Angain thx to you bn for the help :D

Post Reply