在线运行效果请访问:http://tongqiuyan.blog.163.com/blog/static/19554530220119164211339/

    该实例的源码如下:

 
  
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="top" fontSize="12">  
  3.     <mx:Script>  
  4.         <![CDATA[  
  5.             import mx.messaging.MultiTopicConsumer;  
  6.             private function getTime():void  
  7.             {  
  8.                 var pDate:Date = new Date(myPlayer.playheadTime * 1000 || 10);  
  9.                 var tDate:Date = new Date(myPlayer.totalTime*1000);  
  10.                 progressBar.label = dateFormater.format(pDate) + " / " + dateFormater.format(tDate);  
  11.             }  
  12.  
  13.  
  14.         ]]>  
  15.     </mx:Script>  
  16.     <mx:DateFormatter id="dateFormater" formatString="NN:SS" />  
  17.     <mx:Panel width="520" height="400" title="Flex播放器">  
  18.         <mx:VideoDisplay id="myPlayer" autoPlay="false" width="100%" height="100%" playheadUpdate="getTime();" 
  19.                          source="http://d298.v.iask.com/f/1/d75c35113920fe8d63d32ead7bc2f18a62729452.hlv" />  
  20.         <mx:HBox paddingBottom="5" paddingLeft="5" width="100%" verticalAlign="middle">  
  21.             <mx:Image source="http://dl.iteye.com/upload/picture/pic/100759/e0234a4c-a7c1-3b6b-aa96-763f55c89b4e.png" click="myPlayer.play();" width="25" height="25"  />  
  22.             <mx:Image source="http://dl.iteye.com/upload/picture/pic/100757/53003055-7e70-35b8-b91b-28b06b8ae9d0.png" click="myPlayer.pause();"  width="25" height="25" />  
  23.             <mx:Image source="http://dl.iteye.com/upload/picture/pic/100761/e0278852-830d-36ee-9260-a91906cd3902.png" click="myPlayer.stop();" width="25" height="25" />  
  24.             <mx:ProgressBar id="progressBar" source="myPlayer" labelPlacement="center" width="300" />  
  25.             <mx:Label text="Vol" />  
  26.             <mx:HSlider id="volSlider" width="50" minimum="0" value="0.8" maximum="1" snapInterval="0.1" />  
  27.         </mx:HBox>  
  28.     </mx:Panel>  
  29. </mx:Application>  

涉及到控件主要是VideoDisplay、Image、ProgressBar、HSlider等。