What is mouseX and mouseHit for a smartphone ?

Community Forums/Monkey Talk/What is mouseX and mouseHit for a smartphone ?

semar(Posted 2011) [#1]
Hi,
if I do a mouseX() or a mouseHit in a HTML5 or Flash, how it will converted, for example, in an Android smartphone ?

And more, what if I want to save player informations on a remote database (MySql using a PHP script) ? With HTML5 or Flash targets, there are GET/POST at our disposal, but are these commands also available for a smartphone ?

I guess also, that the smartphone on where the app runs, should have an internet connection in order to save/load data from a remote db, shouldn't it ?

Regards,
Sergio.


Xaron(Posted 2011) [#2]
Use TouchDown instead of MouseDown. It will work for both mouse and touch. You get the coordinates with MouseX and MouseY.


semar(Posted 2011) [#3]
Thanks Martin for the tip.

Now, what's about data persistence ? (my second and third question above).


Xaron(Posted 2011) [#4]
Hmm don't know about networking yet.

I only know how to store data local on the phone. This is done with LoadState and SaveState (which is declared in mojo.app), where you serialize your data.

For server persistence you would need a server where all clients connect to. The server can be written in any language so it shouldn't be a problem to use any database system behind. This reduces the problem to networking to the server. There's an ongoing discussion regarding this: http://www.monkeycoder.co.nz/Community/posts.php?topic=635

Last edited 2011