ActiveDen

Timecode to Seconds / Seconds to Timecode AS2/AS3

This is a simple class I created for AS2 and AS3 . It is very handy for video or audio players. For example, say you have a video player and getting the playhead time is easy, right? Right! vidPlayer.playheadTime will give you the amount of seconds. Now you want to display this as a time code instead. You simply do the following:

tc.secondsToTimecode(vidPlayer.playheadTime);

and that will output a string formatted timecode as “01:23:48”

or whatever the seconds happen to be.

This class also supports the opposite. It allows you to convert a string into seconds. This can be handy if maybe you have cue points and you want to insert them via XML with timecodes rather than seconds because timecodes are easier to read. You would simply do:

tc.timecodeToSeconds(“01:23:48” )

and it will return a number in seconds.

Play around with the preview to get a better understanding. My help file explains how to include these in your files.

You must sign in or sign up to purchase this item.

$3Regular Licence

$3

Regular Licence a website (commercial, personal, client), free game, e-card, or presentation - Details

9 Purchases 7 Comments

Buyer Rating
Minimum of 3 votes required
for Rating
rondog

rondog

  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Interviewed on the Envato Notes blog
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 50 and 99 items
  • United States
  • Referred between 100 and 199 users
View Portfolio
Created 23 April 09
ActionScript Version AS3 + AS2
Documentation Well Documented
Opens With Flash 8 (8+)
Published Size 1.2kb
by
by
by
by
by