2 Replies Latest reply on May 30, 2006 3:34 AM by Newsgroup_User

    Converting SECS (0306)  in to Time (5:06)

    GmR Level 1
      I am trying to build a script that will convert SECONDS into HH:MM:SS, as in a duration for a song. I am able to supply the number of seconds in 4 digits... e.g. 0306 (which equals 5:06).

      Can someone help with a script? I will need hours, minutes, seconds.

      Thanks
      Geoff
        • 1. Re: Converting SECS (0306)  in to Time (5:06)
          GmR Level 1
          Ahha -- I discovered a cause of my problems...

          When 0306 is converted to an integer it becomes 198.

          trace (int(0306) ); // =198

          Why is this? How can I convert 0306 to 306?

          Thanks
          Geoff
          • 2. Re: Converting SECS (0306)  in to Time (5:06)
            Level 7
            The leading zero indicates an octal number. Flash converts the value to
            decimal.

            Assuming 0306 is a string, use parseInt("0306",10);


            "GmR" <webforumsuser@macromedia.com> wrote in message
            news:e5h5lb$quc$1@forums.macromedia.com...
            > Ahha -- I discovered a cause of my problems...
            >
            > When 0306 is converted to an integer it becomes 198.
            >
            > trace (int(0306) ); // =198
            >
            > Why is this? How can I convert 0306 to 306?
            >
            > Thanks
            > Geoff
            >