Dismissing answer dialogs after xxx seconds automatically
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Dismissing answer dialogs after xxx seconds automatically
If there any way to automatically dismiss an answer dialog box after xxx seconds.
I realise I can create a separate stack / card and show it, then have it dismiss itself after xxx seconds, but it seems like I would have to add lots of extra code to get the custom stack to show in a viable place, resize itself to the contents of the message etc etc and I'm just wondering if its possible at all to add code to have the existing answer dialog box close without user input.
I realise I can create a separate stack / card and show it, then have it dismiss itself after xxx seconds, but it seems like I would have to add lots of extra code to get the custom stack to show in a viable place, resize itself to the contents of the message etc etc and I'm just wondering if its possible at all to add code to have the existing answer dialog box close without user input.
Re: Dismissing answer dialogs after xxx seconds automaticall
Hi Andy,
just created a button with this script and it worked
You get the picture!
Best
Klaus
just created a button with this script and it worked

Code: Select all
on mouseUp
## Important part to send BEFORE the dialog ;-)
send "closeit" to me in 2 secs
answer "sfasdfasdfasdfasdf"
end mouseUp
command closeit
close stack "Answer Dialog"
end closeit
Best
Klaus
Re: Dismissing answer dialogs after xxx seconds automaticall
Klaus.
Nice.
I love the fact that everything in LC is a stack. Try doing that in HC.
Craig
Nice.
I love the fact that everything in LC is a stack. Try doing that in HC.
Craig
-
- Posts: 32
- Joined: Fri Jan 16, 2015 5:31 pm
Re: Dismissing answer dialogs after xxx seconds automaticall
When attempting this on iOS, Livecode throws error codes 91 (chunk: can't find stack) and 108 (close: can't find stack).Klaus wrote: ↑Wed Nov 06, 2013 7:12 pmCode: Select all
on mouseUp ## Important part to send BEFORE the dialog ;-) send "closeit" to me in 2 secs answer "sfasdfasdfasdfasdf" end mouseUp command closeit close stack "Answer Dialog" end closeit
Since there is only 1 stack when deploying to mobile, is the only option for something like this to create your own modal rather than using the "answer" command?
Re: Dismissing answer dialogs after xxx seconds automatically
You might see if "toast" widgets are a possible option for mobile?
Re: Dismissing answer dialogs after xxx seconds automatically
You could also have a look on AlertBuilder, works in LC 6/7/8/9.
See the description here
viewtopic.php?p=143920#p143920
and/or download from (sorry, currently not available)
See the description here
viewtopic.php?p=143920#p143920
and/or download from (sorry, currently not available)
Last edited by [-hh] on Wed Dec 11, 2019 11:47 pm, edited 1 time in total.
shiftLock happens
Re: Dismissing answer dialogs after xxx seconds automatically
I might have known to suggest checking one of Hermann's nifty stacks first!
Vielen Dank wieder, [-hh]
Vielen Dank wieder, [-hh]
Re: Dismissing answer dialogs after xxx seconds automaticall
Hi MWCoastMedia,
On the desktop/standalones and in the IDE the ASK and ANSWER dialogs are in fact STACKS, but not on mobile!
Here the underlying OS supplies the dialogs and we cannot control them from within LC.
I would create a GROUP which covers the complete card to FAKE an answer dialog, know what I mean?
Best
Klaus
You are six years late for the party!MWCoastMedia wrote: ↑Fri Apr 19, 2019 8:08 pmWhen attempting this on iOS, Livecode throws error codes 91 (chunk: can't find stack) and 108 (close: can't find stack).Klaus wrote: ↑Wed Nov 06, 2013 7:12 pmCode: Select all
on mouseUp ## Important part to send BEFORE the dialog ;-) send "closeit" to me in 2 secs answer "sfasdfasdfasdfasdf" end mouseUp command closeit close stack "Answer Dialog" end closeit
Since there is only 1 stack when deploying to mobile, is the only option for something like this to create your own modal rather than using the "answer" command?

On the desktop/standalones and in the IDE the ASK and ANSWER dialogs are in fact STACKS, but not on mobile!
Here the underlying OS supplies the dialogs and we cannot control them from within LC.
I would create a GROUP which covers the complete card to FAKE an answer dialog, know what I mean?
Best
Klaus