Changing image fileName Based on QT Time...?
johnpatten at mac.com
Tue Oct 19 11:20:12 CDT 2004
I'll check out the sample on your site. I do remember previous mentions about the dangers of "idle."
In my attempts to synch up my slides with audio i began looking at creating a QT SMIL movie using Rev to create the SMIL document. I made some progress after familiarizing myself with SMIL tags, but I was hoping to stay within Rev to do this. Not sure where the SMIL tests would have lead.... I'll check out the example and try some switch statements in conjuction with the callbacks.
On Tuesday, October 19, 2004, at 03:40AM, <use-revolution-request at lists.runrev.com> wrote:
>Date: Tue, 19 Oct 2004 12:13:07 +0200
>From: Klaus Major <klaus at major-k.de>
>Subject: Re: Changing Image FileName Based on QT Time...?
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <7919AD4C-21B7-11D9-862A-000A27B49A96 at major-k.de>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>> Thanks Klaus!
>> I'll check out the "currenttime" of player call in the morning. I was
>> not aware of currentTime of player.
>> Would this be used on an idle script?
>Never use "on idle" or you will get eternal damnation!!! :-D
>(At least as evil as "repeat until the mouse is UP"!)
>Instead use "send xyz... in abc..."
>> Something like:
>> If currentTime is > 20000 then
>> set fileName of image xyz to "slides/slide1.jpg"
>> if currentTime is > 25000 then
>> set fileName of image xyz to "slides/slide2.jpg"
>Well almost, but i would rather use a "switch...case..." handler in
>MUCH MORE readable and less harmful, since there are so many
>to use "if...then" that
>1. most of the time you cannot oversee it with one glance
>2. you forget one "end if" almost EVERYTIME ;-)
>##Start the player:
>on mouseup ## or whenever...
> start player xyz
> put the currenttime of player xyz into CT
> case CT < 20000 AND CT > 10000
> set fileName of image xyz to "slides/slide1.jpg"
> case CT < 30000 AND CT > 20000
> set fileName of image xyz to "slides/slide2.jpg"
> end switch
> if CT < the duration of player xyz then
> ## Sound is not yet finished, so we might have to check again...
> send check_the_time to me in abc millisecs
> end if
>Get the picture?
>But see below...
>> Am i on the right track?
>Yo, but i would suggset to let the player-object do all the work :-)
>I mean set and use "the callbacks" of the player to trigger your change
>I just uploaded a tiny stack "Fun with callbacks" to REV-unline ->
>That will get you started (hopefully) with callbacks, which are a very
>yet quite unknown feature of REV.
>> Thanks again!
>Drop a line (even offlist, if you like) if you need further
>> John Patten
>> Tech Dept
>klaus at major-k.de
More information about the use-livecode