AW: newbie video player questions

Eric Chatonet eric.chatonet at sosmartsoftware.com
Fri Jun 8 09:36:45 EDT 2007


Hi Eddie,

> if time is < 12 go stack morning

Actually  it is what it makes :-)
You need a reference: this one is given by converting the short date  
to seconds.
What is nice is that conversion gives you the seconds at 0:00 then  
you are firmly anchored :-)

As Tiemo told you, you are not obliged to have three substacks,  
closing and opening them but may be only three cards in one substack.
As for the rest, take care I used pseudo code between tag marks: you  
have to write there real code.
As for where to put this handler: in your main stack script for  
instance and you'll add:

on openStack
   if the long name of me = the long name of this stack then  
DisplayRightStack --
end openStack

This condition will ensure that the handler will not run when a  
substack is open.

Le 8 juin 07 à 15:26, eddie d a écrit :

> hi eric, thanks (wow, this is a great list)
> this looks more complicated then I hoped it would be. I was hoping  
> you could just read the system time and have it do stuff according  
> to that. (like if time is < 12 go stack morning)
> but I'll try this.
> were do I put this, in the main stack or in each substack?
>
>
> eddie
>
>>
>>
>>> so now I need to figure out how to let it go to a certain  
>>> substack on a specific time.
>>> I thought I make a subtack for 'morning' one for 'afternoon' and  
>>> one for 'evening' and in each stack are a number of cards with a  
>>> videoplayer
>>> any idea on how to do this?
>>>
>>> eddie d
>>
>> The way to master this is to work with seconds and a pending message:
>>
>> on DisplayRightStack
>>   local tMidnightSeconds
>>   -----
>>   put the short date into tMidnightSeconds
>>   convert tMidnightSeconds to seconds
>>   -- tDate contains the seconds from today at 0:00
>>   if the seconds >= tMidnightSeconds + (9*3600) then -- 9 AM
>>     <go stack "Morning" process>
>>   else if the seconds >= tMidnightSeconds + (14*3600) then -- 2 PM
>>     <close stack "Morning" process>
>>     <go stack "Afternoon" process>
>>   else if the seconds >= tMidnightSeconds + (20*3600) then -- 8 PM
>>     <close stack "Afternoon" process>
>>     <go stack "Evening" process>
>>   else if the seconds < tMidnightSeconds + (9*3600) then -- before  
>> 9 AM
>>      <close stack "Evening" process>
>>    end if
>>   -----
>>   if "DisplayRightStack" is not in the pendingMessages then
>>     send "DisplayRightStack" to me in 60 seconds
>>   end if
>> end DisplayRightStack
>>
>> See seconds, convert, pendingMessages, send and related topics in  
>> the docs.
>>
>> Best regards from Paris,


Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list