• home
  • forum
  • my
  • kt
  • download
  • Flash Video Cue Point Control with Flash Video MX Pro

    Author: 2009-01-06 10:14:33 From:

    Flash Video MX Pro is capable of adding cue points in the generated Flash video (FLV) files. This is a great feature which allows you to synchronize video clips with other Flash elements. Cue points are invisible markers in a video file which can be used to trigger external events such as synchronizing graphics, subtitles, etc; providing navigation options; loading other video files or SWF movies, etc.


    Cue points don't do anything by themselves. They are merely passive markers. To make use cue points you need to write some Actionscript in the SWF file which contains the Flash Video file. The Actionacript code "listens" to the preset cue points and takes whatever action you specify when it encounters one.

    With the CuePoint, professional users can import single video file for encoding or multiple video files for encoding at once.

    Launch Flash Video MX Pro; add CuePoint; see the pictures below:



    flash video cue point



    When the video plays to the frame that you want to add cue point, click the Add button and select a cue point type from the pop-up list. There are two types of cue point you get: Add Event, Add Navigation. If you want to delete the selected cue point, just click the button named “Delete cuepoints”.



    After you finish your setting, then the cue point effect will be appear in the output file you get in the end.



    Generally, Cue Points can be embedded in the FLV file when you encode it. This creates permanent cue points. When the FLV file is played to a preset time point, it will trigger the onCuePoint Event. If you don't want to apply the player offered by the Flash Video MX, you can apply your Action Script to play FLV, coding like the following:

    var nc = new NetConnection(); //construct a NetConnection Object
    nc.connect(null); //make a connection
    var ns = new NetStream(nc); //construct a NetStream Object with nc
    videoScr.attachVideo(ns); //videoScr is a video instance placed in the scene
    ns.play("xxx.flv"); //to start play the video, xxx.flv is your flv name, it can be an absolute or relative URL
    ns.pause(true); //pause video
    ns.pause(false); //resume to play video
    ns.seek(t); //seek to t seconds
    ns. onCuePoint = function(info)
    {
    trace(info.name); //get cue point name
    trace(info.time); //get cue point time in seconds
    trace(info.type); //get cue point type, "event" or"naviagtion"
    trace(info.parameters["param_name"]); //get cue point's param_name value
    }

    If you apply the player offered by the Flash Video MX to play the FLV file, you can handle Cue Point Event like the following. Please refer to the document for Player API for more details.

    var listener:Object = new Object();//construct an event listener object
    listener.onEvent = function(sender, type, name, info)
    {
    if (name == "onCuePoint") {//handle onCuePoint event
    trace(info.name);//get cue point name
    trace(info.time); //get cue point time in seconds
    trace(info.type);//get cue point type, "event" or"naviagtion"
    trace(info.parameters["param_name"]);//get cue point's param_name value
    }
    }
    thePlayer.AddListener(listener);//add event listener so that the listener can get the "onCuePoint" event.

    discuss this topic to forum

    relation tutorial

    No information

    Category

      3D (29)
      Math Physics (17)
      3rd Party (8)
      Navigation (65)
      Actionscripting (181)
      Optimization (17)
      Animation (128)
      Projector (11)
      Audio (52)
      Special Effects (157)
      Backend (26)
      Text Effects (86)
      Drawing (32)
      Tips and Techniques (47)
      Dynamic Content (32)
      Tricks (8)
      Games (101)
      Utilities (23)
      Getting Started (92)
      Video (41)
      Interactivity (43)
      Web Design (29)

    New

    Hot