<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()">
<mx:Script>
<![CDATA[
import mx.binding.utils.BindingUtils;
import mx.events.SliderEvent;
import mx.controls.Alert;
import mx.events.VideoEvent;
private var i:int=0;
[Bindable]
private var total:String="";
private function init() : void
{
myVid.addEventListener(VideoEvent.COMPLETE, function(event : VideoEvent) : void
{
Alert.show("complete!");
//myVid.source=null;
//myVid.source="phone.flv";
}
);
myVid.addEventListener(VideoEvent.READY, function(event : VideoEvent) : void
{
Alert.show("ready!",myVid.totalTime.toString());
my_hs.labels=['0',formatTimes(myVid.totalTime)];
}
);
}
private function playingMove(event:VideoEvent):void{
my_hs.value = event.playheadTime;
my_hs.maximum=myVid.totalTime;
}
private function playUrl(url:String):void
{
Alert.show("dddd",url);
if(myVid.playing)
myVid.stop();
myVid.source = url;
myVid.play();
}
private function formatTimes(value:int):String{
var result:String = (value % 60).toString();
if (result.length == 1){
result = Math.floor(value / 60).toString() + ":0" + result;
} else {
result = Math.floor(value / 60).toString() + ":" + result;
}
return result;
}
private function hs_onchange(event:SliderEvent):void{
myVid.playheadTime = event.value;
}
private function video_ready():void{
Alert.show("ready!");
}
]]>
</mx:Script>
<mx

anel title="VideoDisplay Control Example" height="75%" width="75%"
horizontalAlign="center"
paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
<mx:Text width="75%" color="blue"
text="Use the buttons to control the video. The Stop button resets the video to the beginning."/>
<mx:VideoDisplay id="myVid" height="158" width="211" playheadUpdate="playingMove(event);" source="http://www.helpexamples.com/flash/video/water.flv" autoPlay="true" />
<mx:HBox>
<mx:Button label="

lay" click="myVid.play();"/>
<mx:Button label="

ause" click="myVid.pause();"/>
<mx:Button label="Stop" click="myVid.stop();"/>
</mx:HBox>
<mx:ControlBar id="ctrlBar1" x="10" y="357" width="545" height="52">
<mx

abel x="480" y="341" id="playtime"
text="{formatTimes(myVid.playheadTime)} : {formatTimes(myVid.totalTime)}"
color="#ffffff"/>
<mx:HSlider minimum="0" value="{Number(formatTimes(myVid.playheadTime))}" id="my_hs" maximum="{Number(formatTimes(myVid.totalTime))}" change="hs_onchange(event)" width="179"/>
</mx:ControlBar>
</mx

anel>
</mx:Application>
这是我的代码 你能帮我看哈错在哪里啊