Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: Re: how to set getTimer ?????
From: tomasz
Date: Tue, 24 Oct 2000 16:43:55 +0100

on 10/23/00 11:01 PM, Grant Davies at grantatbluetube [dot] com wrote:

hehe...I tried this and I must say it's too advanced for me, I con't get it
to work, I'm just lost in there...help if you have time if not i'll try to
manage.

Thanks in advance

tom
--
tomasz walenta
o r a n g e t a n g o
twalentaatorangetango [dot] com
T : 514.286.0022
F : 514.499.0160



> hehe... I wrote a generic timer class... I don't have time to do the
> tutorial right now, but that is my plan in the long run.
>
> I don't have the time right now to go through it in detail but here is my
> action script code, I only finished it last night so it will need
> cleanup/tweeks.
>
>
> for frame 1
>
> stop();
>
> // initialize variables
> started = false;
> listener = null;
> timeOut = 0;
>
>
>
>
> function startTimer()
> {
> if (started == true)
> return;
> // _root.log(this,"Starting timer");
> started = true;
> startTime = getTimer();
> gotoAndPlay(2);
> }
>
> function stopTimer()
> {
> if (started ==false)
> return;
> // _root.log(this,"Stopping timer");
> started = false;
> stop();
> }
>
> function getElapsedTime()
> {
> timeNow = getTimer();
> return (timeNow - startTime);
> }
>
> function addListener(pListener, pTimeout)
> {
> _root.log(this,"adding listener [" + pListener +"]");
> listener = pListener;
> timeOut = pTimeout;
> startTimer();
>
> }
>
> frame 2 is empty
>
>
> now in frame 3 I have the following
>
> if (listener !=null)
> {
> // if there is a listener see if it needs to be notified of the timer
>
> timeNow = getElapsedTime();
> if (timeNow >= timeOut)
> {
> // we hit the timeout!
> listener.handleTimer();
> }
> else
> gotoAndPlay (2);
> }
> else
> {
> gotoAndPlay (2);
> }
>
>
>
> the movie that actually needs the timer has the following action script
>
>
> and where ever I want to set the timer (say for 4 seconds)
>
> timer.addListener(this, 4000); // this start the timer and tell it to notify
> me when 4 seconds have passed
>
> function handleTimer()
> {
> timer.stopTimer();
> trace("Timer went off!!!)
> }
> }
>
>
>
> Grant Davies
> b l u e t u b e p r o d u c t i o n s
> http://www.bluetube.com
>
> -----Original Message-----
> From: owneratchinwag [dot] com [owneratchinwag [dot] com]On">mailto:owneratchinwag [dot] com]On Behalf Of tomasz
> Sent: Monday, October 23, 2000 10:33 PM
> To: flasheratchinwag [dot] com
> Subject: FLASH: Re: how to set getTimer ?????
>
>
>
> Hi,
>
> I have a movie clip with 25 frames, what I want to do is for the movie to
> stop on each frame for 10 seconds and then to move to the next frame and
> stop for another 10 seconds and so on until frame 25.
>
> Can you help me with this ?
>
> tom
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> NudeGuru.com is proud to sponsor the Flasher list
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> IT'S THE ART OF MONEY, HONEY!
> Tips and Advice from some of the most popular Flash
> artists + industry power-brokers on how to hold onto
> your rights, negotiate contracts and get full value
> for your work.http://www.nudeguru.com from Franke James
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
> http://www.chinwag.com/flasher or email helpatchinwag [dot] com
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> NudeGuru.com is proud to sponsor the Flasher list
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> IT'S THE ART OF MONEY, HONEY!
> Tips and Advice from some of the most popular Flash
> artists + industry power-brokers on how to hold onto
> your rights, negotiate contracts and get full value
> for your work.http://www.nudeguru.com from Franke James
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
> http://www.chinwag.com/flasher or email helpatchinwag [dot] com
>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  RE: FLASH: Re: how to set getTimer ?????, Grant Davies

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]