Mega Code Archive

 
Categories / Flex / Graphics
 

Set cue points for the VideoDisplay control by using the cuePointManager property

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Script>                  import mx.events.CuePointEvent;                  private function initCP():void {             var myCuePoints:Array = [                 { name: "first", time: 10},                 { name: "second", time: 20} ];                     myVid.cuePointManager.setCuePoints(myCuePoints);         }         private var currentCP:Object=new Object();                  private function cpHandler(event:CuePointEvent):void {             cp.text="go to cuepoint: " + event.cuePointName + " " + String(event.cuePointTime);             currentCP.name=event.cuePointName;             currentCP.time=event.cuePointTime;             myVid.cuePointManager.removeCuePoint(currentCP);             cp.text="Cue points remaining: " + String(myVid.cuePointManager.getCuePoints().length);         }            </mx:Script>     <mx:VBox>         <mx:VideoDisplay id="myVid" initialize="initCP();"             cuePointManagerClass="mx.controls.videoClasses.CuePointManager"             source="http://localhost:8100/MyVideo.flv"             cuePoint="cpHandler(event);" />         <mx:TextArea id="cp" width="200" />     </mx:VBox> </mx:Application>