EDIT: I changed the topic title to reflect better the problem
When you need to do some long operations you need to prevent user to continue to click on buttons and start operations.
In this situation I tried to use a blended cover button to put over the card. Unfortunately you can continue to tap and have the script of the buttons activated, because I hide the cover button as soon as the operation is finished. My only solution is to wait some ticks before to hide the cover button?
PS
Also, what is the best way to trap also the taps when you are switching from a card to another? I see that you can tap and the object that receives it it's the one under the finger in the new card, which is not good
Last edited by Mag on Sun Jun 23, 2013 10:11 am, edited 1 time in total.
What exactly is the reason that you don't want the user to click the button again right after the script finishes?
I often see people disable a button while it is performing a task. One should not do this, because if something goes wrong in the script, the feature can't be accessed any more until the programme is restarted. Instead, you can check if the script is currently running:
local lBusy
on mouseUp
if lBusy is true then
beep
answer warning "I'm busy. Do you want me to start again?" with "OK" or "Cancel"
if it is "Cancel" then
exit mouseUp
else
put false into lBusy
send "mouseUp" to me in 100 millisecs
end if
end if
put true into lBusy
repeat with x = 1 to 1000000 with messages
if lBusy is false then exit mouseUp
// do something here
wait 0 millisecs with messages
end repeat
put false into lBusy
end mouseUp
This is just an example. You'll have to adjust the script to your own needs.
Kind regards,
Mark
Last edited by Mark on Thu Jun 20, 2013 5:22 pm, edited 1 time in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark, thank you for the interesting code, I will study it!
I have two buttons, one of them goes to the next card and one start to record a video (with mergAV). I need to disable them because mergAV camCreate control need some time to create the control and I don't want people can click on the two buttons while the control is not ready.
I need this to avoid that an user see starting things without learning why (infact the user tap is queued and fire when the control is created some second after the tap)...
Yeah, you're right. I'll edit the code. I think that "Cancel" should be the default.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
What about displaying a black screen on top of everything else with a white circular progress indicator until the recording video object appears?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
No, another stack makes things more complicated on iOS. Just show a group with a black rectangle as large as the card the progress indicator, covering everything else. Hide it when the recording control has appeared or when the user stops recording, whichever is easier or looks better.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Thanks, this is exactly what I'm searching to do. The problem is that the mouse event (e.g. mouseUp) is performed by LiveCode at the end of the creation of the control, not when it takes place. At that time there is not any curtain...
So I guess i have to find a way to learn when the control is ready and remove the curtain only some time after that. Currently the remove curtain statement is just after the create control one: