转载请保持文章完整性!
本文链接地址:http://blog.desizen.com/4lone/589.html
主页:joel's blog
这个例子进行的是Tourdeflex:UI Controls:Other Controls:VideoDisplay
本例子用到了一个flv文件,点此下载.下载后解压放入src文件夹内.
简介:
The VideoDisplay control lets you play an FLV file in a Flex application. It supports progressive download over HTTP, streaming from the Flash Media Server, and streaming from a Camera object.
例子:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="top" horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ [Bindable] private var TitleText:String = "<b>VideoDisplay Control:</b>" + "/n" + "Use the buttons to control the video."; ]]> </mx:Script> <mx:VBox backgroundColor="0x323232" width="400" height="240" backgroundAlpha="1" horizontalAlign="center" borderThickness="4" borderColor="0x545454" cornerRadius="4" borderStyle="solid" paddingTop="5" > <mx:Text width="75%" color="0xffffff" textAlign="center" htmlText="{TitleText}"/><!--使用html方式显示标题--> <mx:VideoDisplay id="myVid" height="146" width="220" source="assets/sample_vid.flv" autoPlay="false"/> <mx:HBox> <mx:Button label="Play" color="0x00000" click="myVid.play();"/><!--控制按钮--> <mx:Button label="Pause" color="0x00000" click="myVid.pause();"/> <mx:Button label="Stop" color="0x00000" click="myVid.stop();"/> </mx:HBox> </mx:VBox> </mx:Application>