Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
| Subject: | RE: FLASH: Re: how to set getTimer ????? |
| From: | Grant Davies |
| Date: | Tue, 24 Oct 2000 04:18:24 +0100 |
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: owner
Sent: Monday, October 23, 2000 10:33 PM
To: flasher
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 help
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 help
Replies
Re: FLASH: Re: how to set getTimer ?????, tomasz
Re: FLASH: Re: how to set getTimer ?????, tomasz
Replies
FLASH: Re: how to set getTimer ?????, tomasz
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]

