Timed User Input

Mark Smith lists at futilism.com
Fri Jul 17 11:40:53 EDT 2009


Rick, the 'send-in-time' could work like this:

on runTimer pTimeLeft
   if pTimeLeft is a number and pTimeLeft > 1 then
     subtract 1 from pTimeLeft
     put pTimeLeft into fld "timeLeft"
     send "runTimer pTimeLeft" to me in 1 second
   end if
end runTimer

where, if you want to allow 30 seconds, you'd start the timer with

runTimer 30

it will then run down to 0 and stop, allowing everything else to keep  
running in the meantime.
In this case, I've imagined a field called "timeLeft" that shows the  
time left, and you could check that to see when time's up.

Best,

Mark

On 17 Jul 2009, at 16:31, Rick Harrison wrote:

> Hi Marc,
>
> No, I'm not using "with messages".  That may be the solution!
> I'll give that a try.
>
> Thanks!
>
> Rick
>
> On Jul 17, 2009, at 11:26 AM, Marc Siskin wrote:
>
>> Rick,
>>
>> Are you using the "with messages" modifier in your timing loop?   
>> (e.g. wait 5 seconds with messages) This keeps the timer running  
>> and allows you to check for input, button clicks, etc.
>>
>> Marc
>>
>> On Jul 17, 2009, at 11:19 AM, Rick Harrison wrote:
>>
>>> Hi Mark,
>>>
>>> I was using a repeat loop.  Hmm.. send-in-time.
>>> What is that?
>>>
>>> I'm not using a dialog such as answer or ask.
>>> I was going to use a field for input, but have
>>> been leaning more towards a multiple choice
>>> solution with "mouseWithin", or anything else
>>> which might work.
>>>
>>> Rick
>>>
>>>
>>>
>>> On Jul 17, 2009, at 11:01 AM, Mark Smith wrote:
>>>
>>>> Rick, how have you done your timer - a repeat loop or a 'send-in- 
>>>> time' ?
>>>>
>>>> Best,
>>>>
>>>> Mark
>>>>
>>>> On 17 Jul 2009, at 15:48, Rick Harrison wrote:
>>>>
>>>>> I'm trying to set up a guessing game where
>>>>> the user has to race against a timer to give
>>>>> an answer before the time runs out.
>>>>>
>>>>> The problem is that when the user is asked
>>>>> for input, the timer stops due to the interrupt.
>>>>> Or the timer keeps running, and doesn't allow
>>>>> any user input.
>>>>>
>>>>> To work correctly the timer should still be
>>>>> counting down as the user is trying to
>>>>> answer the question.
>>>>>
>>>>> Any thoughts, ideas, or suggestions are
>>>>> greatly appreciated.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Rick
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> use-revolution mailing list
>>>>> use-revolution at lists.runrev.com
>>>>> Please visit this url to subscribe, unsubscribe and manage your  
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>>
>>>> _______________________________________________
>>>> use-revolution mailing list
>>>> use-revolution at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your  
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>> __________________________________
>>> Rick Harrison
>>>
>>> You can buy my $10 music album "Funny Time Machine" digital CD on  
>>> the iTunes Store Now!
>>>
>>> To visit the iTunes Store now to listen to samples of my CD  
>>> please click on the
>>> following link.  (Please note you must have iTunes installed on  
>>> your computer for this link to work.)
>>>
>>> http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum? 
>>> playListId=213668290
>>>
>>>
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your  
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>
>> ---------------
>> Marc Siskin
>> Manager, Modern Language Resource Center
>> Carnegie Mellon University
>> msiskin at andrew.cmu.edu
>>
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> __________________________________
> Rick Harrison
>
> You can buy my $10 music album "Funny Time Machine" digital CD on  
> the iTunes Store Now!
>
> To visit the iTunes Store now to listen to samples of my CD please  
> click on the
> following link.  (Please note you must have iTunes installed on  
> your computer for this link to work.)
>
> http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum? 
> playListId=213668290
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list