8 Replies Latest reply on Nov 6, 2007 11:59 PM by Boxing Boom

# change mileseconds into seconds on script

Hi All,

Hi All,

Script is attached ;)

Can anyone tell me how to change the above script to produce seconds and not miliseconds?

I ideally would like the following to be displayed:

Playing 5 sec. of 25 sec. (88%)

At present it is producing:

228298 of 228298 bytes (100%)
14211 of 14263 milliseconds (100%)

Would someone please show me how the above is acheived, I am desperate to know this ASAP ;)

Kind Regards,

Boxing Boom - forever jumping in a the deep end ;()

• ###### 1. Re: change mileseconds into seconds on script
lol. Might need kglad for these tough math questions, but I'll take a shot.

seconds = milliseconds / 1000

• ###### 2. Re: change mileseconds into seconds on script
Hi,

Yes it is true that; seconds=milliseconds/1000 - however this doesn't help my situation, but thanks for having a go ;~)

Kind Regards,

Boxing Boom
• ###### 3. Re: change mileseconds into seconds on script
it would help if you apply that information to your situation:

• ###### 4. change mileseconds into seconds on script
Hi,

Yep, I knew if anyone could provide an answer, it had to be either clbeech or kglad.

Now, not wanting to rock the boat, but how would one have minutes and seconds as follows:

2:10
It will obviously involve / 60?

Many thanks, your time and consideration is much appreciated.;~)

Kind Regards,

Boxing Boom
• ###### 5. Re: change mileseconds into seconds on script
I'll take a shot :) lol!!!! how about:

• ###### 6. change mileseconds into seconds on script
Hi Clbeech,

You 'THE ONE', and todays results from Copy & Paste are as follows;)

0:14 of 0:14 - time lapsed (100%)

And the line of code:
status_txt.text += Math.floor(Math.round(the_sound.position/1000)/60)+":"+Math.floor(Math.round(the_sound.po sition/1000)%60)+" of "+Math.floor(Math.round(the_sound.duration/1000)/60)+":"+Math.floor(Math.round(the_sound. duration/1000)%60)+" - time lapsed ("+pos.toString().substr(0,5)+"%)"+newline;

I take it that if the sound file went into minutes, it would look similiar to 3:08 etc... I will test and post tomorrow.

Just wondering, if you were to change anything, what would that change be?

Kglad and Clbeech; if ever these two people went into business together, Millionaires?

What me is thinking is, I got the /60 right. Right? ;) Maybe a few thou is due ;~))

Kind Regards,

Boxing Boom
• ###### 7. Re: change mileseconds into seconds on script
lol!! probably the 'trace' instead of assigning it to the textfield instance, LOL!!!!

hello??!?!??!!!! lol!!
• ###### 8. Re: change mileseconds into seconds on script
HI,

Did my test and here is the result;

2242873 of 2242873 bytes (100%)
3:7 of 3:7 - time lapsed (100%)

Nice, but it would look better if the time was changed to this fromat 03:07 how would this be achieved?

Kind Regards,

Boxing Boom