A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: flv duration

  1. #1
    Senior Member
    Join Date
    Mar 2006
    Posts
    139

    flv duration

    hello, im using this:

    PHP Code:
    import fl.video.*; 

    flvPlayback.addEventListener(MetadataEvent.METADATA_RECEIVEDtimeListener); 

    var 
    durationTime:String 
    function timeListener(eventObject:MetadataEvent):void 
       var 
    totalSeconds String(eventObject.info.duration); 
       
    durationTime = (totalSeconds 3600 Math.floor(totalSeconds 3600) + ":" "") + (totalSeconds 3600 600 "0" "") + Math.floor(totalSeconds 3600/60) + ":" + (totalSeconds 60 10 "0":"") + totalSeconds 60
       
    //totalTime.text = durationTime; 

    stage.addEventListener(Event.ENTER_FRAMEupdateTime); 

    function 
    updateTime (event:Event):void 
       var 
    elapsedSeconds String(flvPlayback.playheadTime); 
       var 
    runTime:String = (elapsedSeconds 3600 Math.floor(elapsedSeconds 36000) + ":" "") + (elapsedSeconds 36000 600 "0" "") + Math.floor(elapsedSeconds 36000/60) + ":" + (elapsedSeconds 60 10 "0":"") + elapsedSeconds 60 
       
    elapsedTime.text = (runTime ":" durationTime);//<----here is where time shows 

    to display my flvs' duration, works a treat except it displays the time to about a million decimal places and i only want minutes and seconds, is there a way i can round this up to the nearest second?

    thanks!

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You can define the datatype for the seconds variable as int, which will give only rounded numbers.
    - The right of the People to create Flash movies shall not be infringed. -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center