Page 1 of 1

mouseDown not good for mobile platform

Posted: Sun Feb 26, 2012 3:18 pm
by kroghet
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

Re: mouseDown not good for mobile platform

Posted: Sun Feb 26, 2012 5:27 pm
by bn
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

Re: mouseDown not good for mobile platform

Posted: Sun Feb 26, 2012 5:57 pm
by Dixie
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

Re: mouseDown not good for mobile platform

Posted: Sun Feb 26, 2012 7:21 pm
by kroghet
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