help me
Moderator: Klaus
help me
hi everyone
I don"t know why
following script is work well on pc
but not work on the android phone
'repeat until the mouseClick'
or
'repeat until the mouseClick is true'
I have tested this script for many days
and I knew
"the mouseClick" function is not work on android
I think this problem may be error of Livecode
right?
anyone help me
warm regard
I don"t know why
following script is work well on pc
but not work on the android phone
'repeat until the mouseClick'
or
'repeat until the mouseClick is true'
I have tested this script for many days
and I knew
"the mouseClick" function is not work on android
I think this problem may be error of Livecode
right?
anyone help me
warm regard
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: help me
hi sunkim - actually the dictionary says the mouseClick as also available on Android...
"...this is not the code you are looking for..."
Re: help me
hi dave
would you give me a sample script?
I did some sample script in dictionary
but did not work on android
would you give me a sample script?
I did some sample script in dictionary
but did not work on android
Last edited by sunkim on Wed Jun 17, 2015 9:54 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: help me
hi sunkim - no, I think the best thing would be for you to post your script so we can see what you are trying to do and where any bugs might lurk that you've missed...
dave
dave
"...this is not the code you are looking for..."
Re: help me
hi dave
it doesn't work very simple script like this
on mouseup
repeat until the mouseClick
beep
end repeat
end mouseup
what's wrong?
thank's your answer
sunkim
it doesn't work very simple script like this
on mouseup
repeat until the mouseClick
beep
end repeat
end mouseup
what's wrong?
thank's your answer
sunkim
Last edited by sunkim on Wed Jun 17, 2015 10:10 pm, edited 1 time in total.
Re: help me
If this is not a bug, then certainly it's a documentation error.
By default, errors on Android fail silently without explanatory messages. Using the mouseClick syntax never triggers the repeat loop. I therefore believe the mouseClick is not supported on Android, despite what the Dictionary says. I can sort of see why, since there is no mouse, but the mouse messages have been ported to the mobile platforms, so maybe this function has been overlooked.
Anyway, you can work around this issue by updating the card script to:
By default, errors on Android fail silently without explanatory messages. Using the mouseClick syntax never triggers the repeat loop. I therefore believe the mouseClick is not supported on Android, despite what the Dictionary says. I can sort of see why, since there is no mouse, but the mouse messages have been ported to the mobile platforms, so maybe this function has been overlooked.
Anyway, you can work around this issue by updating the card script to:
Code: Select all
on openCard
set the cRunning of this card to true
repeat until the cRunning of this card is false
nextword
wait for 100 milliseconds with messages
--include "with messages" to make sure the engine has a chance to poll
--for interactive events without the repeat loop taking over all cycles
end repeat
end openCard
on touchStart
set the cRunning of this card to false
end touchStart
Last edited by SparkOut on Wed Jun 17, 2015 10:09 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: help me
hi sunkim - could you post some code that is actually from your stackfile - it makes a difference if you send actual code rather than pseudo code - if you send actual code we can see where bugs may be hiding - if you send pseudo code then we can't help (it's a bit like going to the doctor with a pseudo 'bad leg' - the doctor needs to see your actual, real 'bad leg')
So, why not zip up your stackfile and post it here?
Kind regards
Dave
So, why not zip up your stackfile and post it here?
Kind regards
Dave
"...this is not the code you are looking for..."
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: help me
well done sparkout - you were more helpful and more giving than me!
"...this is not the code you are looking for..."
Re: help me
hi dave
I'll try your code
and thanks lot your advice
sunkim
I'll try your code
and thanks lot your advice
sunkim
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: help me
sunkim - it was sparkout and not me who posted code for you...
"...this is not the code you are looking for..."
Re: help me
hi sparkout
thanks lot
I'll try your code
sunkim
my english is short
thanks lot
I'll try your code
sunkim

Re: help me
I'm thinking the actual issue may have been the "beep" and a repeat loop with no delay.
Simon
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: help me
I didn't use beep but I did try it out, using the code structure sunkim requested help with in the original post on the same lines. The mouseClick definitely fails on Android. The repeat loop never even triggers.
Re: help me[solved]
hi SparkOut
thank you very much
your code worked well
my problem have solved by you
again thanks lot
thank everyone

sunkim
thank you very much
your code worked well
my problem have solved by you
again thanks lot
thank everyone

sunkim
Re: help me
SparkOut's method is the recommended way to handle mouse events inside a repeat loop. I think "mouseclick" is supported on Android but isn't reliable inside a loop. I just did a quick Android test with this handler:
The repeat loop does run for me and the seconds are updated as expected. But a tap does not exit the repeat, no matter where I tap on screen. If I had used "beep" instead of the seconds like the OP, expecially without any wait time, the overhead for the audio to load would take longer than the time for the next iteration of the loop, so I suspect that's why no beeps were heard.
Repeat loops shouldn't use the mouseclick as an exit test even on desktop apps because of the way LC tests for a click. If the click is not completed at the exact moment the test occurs, it will be missed. If you click while the interior of the loop is running, it won't always be recognized. On desktops it seems to be a little more reliable, maybe because those machines are faster, but it will still miss some clicks occasionally if the timing isn't exactly right.
There is more info here about testing for various mouse conditions: http://www.hyperactivesw.com/polling.html The example uses a mouseMove handler to explain, but a repeat loop should use the same method, just as SparkOut's solution does.
Code: Select all
on mouseUp
repeat until the mouseclick
put the seconds into fld 1
wait 1 with messages
end repeat
end mouseUp
Repeat loops shouldn't use the mouseclick as an exit test even on desktop apps because of the way LC tests for a click. If the click is not completed at the exact moment the test occurs, it will be missed. If you click while the interior of the loop is running, it won't always be recognized. On desktops it seems to be a little more reliable, maybe because those machines are faster, but it will still miss some clicks occasionally if the timing isn't exactly right.
There is more info here about testing for various mouse conditions: http://www.hyperactivesw.com/polling.html The example uses a mouseMove handler to explain, but a repeat loop should use the same method, just as SparkOut's solution does.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com