Seek as2 code to display elapsed time

Posted on 2006-06-11
Last Modified: 2008-02-01
I need a utility to help in testing a new project...looking for a dead simple way to display time elased since beginning of the movie.
Question by:juststeve
  • 2

Expert Comment

ID: 16880469

myTime= getTimer()/1000

it will return the elapsed since the SWF file started playing, I divided by 1000 as it returns in milliseconds

can't be more simple  than this :)


Author Comment

ID: 16880583

Now to complicate things a bit. I'm developing a slideshow where knowing the elapsed time will be required to pinpoint exactly where stuff is occuring so I can determine where the next stuff should occur. I have a 'Pause' button that will stop all the currently running tweens. How can I code this timer so it pauses too.

The tweens are coded, not timeline-based.

Accepted Solution

Ramy_atef earned 500 total points
ID: 16880667
u can't pause it ... but when u make the pause , you can save the current time in a variable and use it when u play again

for ex.

Tnow= getTimer()/1000

when u play again

Tnow=getTimer()/1000 -Tnow

PS.  I'm talking theoretically, i didn't see your work..

the setInterval may also be useful for you, so consider it ..


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question