When the playhead of the VideoDisplay control reaches a cue point, it dispatches a cuePoint event : VideoDisplay « Graphics « Flex






When the playhead of the VideoDisplay control reaches a cue point, it dispatches a cuePoint event

        

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<!-- controls\videodisplay\VideoDisplayCP.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" height="450"
    creationComplete="myVid.pause();">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
    <fx:Script>
         
        import mx.events.CuePointEvent; 
        import mx.controls.videoClasses.CuePointManager; 
        private function cpHandler(event:CuePointEvent):void { 
            cp.text+="Got to " + event.cuePointName + " cuepoint @ " + String(event.cuePointTime) + " seconds in.\n"; 
        } 
      
    </fx:Script>
    <mx:VBox>
        <mx:VideoDisplay id="myVid" source="../assets/MyVideo.flv"
            cuePointManagerClass="mx.controls.videoClasses.CuePointManager"
            cuePoint="cpHandler(event);" height="250" width="250">
            <mx:cuePoints>
                <fx:Object name="first" time="5" />
                <fx:Object name="second" time="10" />
            </mx:cuePoints>
        </mx:VideoDisplay>
        <mx:Label text="{myVid.playheadTime}" />
        <mx:TextArea id="cp" height="100" width="250" />
    </mx:VBox>
    <mx:HBox>
        <mx:Button label="||" click="myVid.pause();" />
        <mx:Button label="&gt;" click="myVid.play();" />
    </mx:HBox>
</s:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Look up VideoDisplay's metadata cuePoints and compare to current cue point object
2.Listen for a Flash Video's cue points with VideoDisplayListen for a Flash Video's cue points with VideoDisplay
3.Use Button to control VideoDisplayUse Button to control VideoDisplay
4.Ready, rewind, playheadUpdate, close, complete and progress actions for VideoDisplayReady, rewind, playheadUpdate, close, complete and progress actions for VideoDisplay
5.autoPlay, autoRewind for VideoDisplayautoPlay, autoRewind for VideoDisplay
6.Detect connection error when loading flv with VideoDisplayDetect connection error when loading flv with VideoDisplay
7.Detecting a connection error when loading an FLV with the VideoDisplay controlDetecting a connection error when loading an FLV with the VideoDisplay control
8.Use a VideoDisplay controlUse a VideoDisplay control
9.Set cue points for the VideoDisplay control by using the cuePointManager property.Set cue points for the VideoDisplay control by using the cuePointManager property.
10.Use VideoDisplay.attachCamera() method to display a video stream from a camera
11.Use VideoDisplay control to import a media stream from Macromedia Flash Media Server 2 from Adobe
12.A VideoDisplay control
13.VideoDisplay CuePoint Manager
14.VideoDisplay Camera
15.VideoDisplay FMSVideoDisplay FMS
16.Load video with Remote Data ProvidersLoad video with Remote Data Providers
17.Play video with VideoPlayPlay video with VideoPlay
18.Play video from a URLPlay video from a URL
19.Create a Video DisplayCreate a Video Display
20.Complete and mediaPlayerStateChange events dispatched by the VideoPlayer controlComplete and mediaPlayerStateChange events dispatched by the VideoPlayer control
21.Show the user of the DynamicStreamingVideoSource objectShow the user of the DynamicStreamingVideoSource object
22.Dispatch a cuePoint eventDispatch a cuePoint event
23.CuePointEvent DemoCuePointEvent Demo
24.Use the pause() and play() to pause or play an FLV fileUse the pause() and play() to pause or play an FLV file