|
Dan It's not a HSlider but a progress bar set to increment via Netstream.time This handler is triggered via a NetStatusEvent public function timeHandler(event:TimerEvent):void{ this.elapsedTime = stream.time rFlex.bar.setProgress(new Number(this.elapsedTime),uint(mmd.duration)); if(this.elapsedTime >= uint(mmd.duration)){ this.elapsedTime = 0; dispatchEvent(new Event(TimerEvent.TIMER_COMPLETE)); } } Here is the code for formating private function formatTimeString(sTime:String):String{ var hours:String; var mins:String; var secs:String; var formatter:NumberFormatter = new NumberFormatter(); formatter.rounding = NumberBaseRoundType.DOWN; formatter.precision = -1; var iDuration:int = uint(sTime) var iHours:int = iDuration/3600; var iMinutes:int = iDuration/60; // Do hours string if (iHours < 1){ hours = "00"; }else if(iHours >= 10){ hours = formatter.format(iHours); }else{ hours = "0" + formatter.format(iHours); } // Do minutes String if(iMinutes < 1){ mins = "00"; }else if(iMinutes >= 10){ mins = formatter.format(iMinutes); }else{ mins = "0" + formatter.format(iMinutes); } var iSeconds:int = iDuration - (iMinutes * 60); if (iSeconds < 10){ secs = "0" + formatter.format(iSeconds); }else{ secs = formatter.format(iSeconds); } return hours + ":" + mins + ":" + secs; } private function formatSize(sSize:int):String{ var formatter:NumberFormatter = new NumberFormatter(); formatter.rounding = NumberBaseRoundType.NEAREST; formatter.precision = 2; if (sSize < 1000){ return sSize.toString() + " Bytes"; }else if ((sSize >= 1000) && (sSize < 100000)){ return formatter.format(sSize/1000) + " Kb"; }else{ return formatter.format(sSize/1000000) + " Mb"; } } private function formatFPS(fps:String):String{ var formatter:NumberFormatter = new NumberFormatter(); formatter.rounding = NumberBaseRoundType.NEAREST; formatter.precision = -1; return formatter.format(fps) + " FPS"; } Took forever? Hmmm... what type of pipe do you have? Dan Rossi said the following: I like how you styled the hslider, curious how this is done. its not draggable though and doesnt completely end at the end. Im also curious to know if you have managed to work out how to format the duration in hours minuts seconds from the netstream time, i tried using the date formatter class, it seems to increase the memory usage and noone on the flex list helped ! --
Whether you think that you can, or that you can't, you are usually right. |
_______________________________________________ Red5 mailing list [email protected] http://osflash.org/mailman/listinfo/red5_osflash.org
