Skip to main content
February 8, 2010
Question

Elapsed Time

  • February 8, 2010
  • 1 reply
  • 683 views

Hi Everyone,

Is it possible to calculate the total seconds playing inside the movieclip. (As per the Elapsed time indicator in IDE).

Thanks in Advance

Saransoft

This topic has been closed for replies.

1 reply

February 8, 2010

Not sure what you mean by inside the movieClip, but to calculate elpased time you can use the getTimer() method like so:

import flash.utils.getTimer;

var startTime:int = getTimer();

var elapsedTime:int = getTimer() - startTime;

That will give you elpased time in milliseconds. If you want seconds just divide by 1000.

February 9, 2010

Hi,

Thanks for your valuable reply.

I created a movieclip and place the animation layers inside the movieclip.

then i place the movieclip on the stage. ( only it will be in first frame, there is no second frame ).

I want to know about the elapsed time for that movieclip (not for the timeline).

Is it possible to find that elasped time for the particular movieclip.

Thanks in advance,

Saransoft

Inspiring
February 10, 2010

Link the movieclip to an external class that you create yourself (make sure it extends MovieClip) then paste that get timer code inside that class instead, you can then reference the variables through the instance of the movieclip.