Home > Flash Video MX Pro > FLV Player
How to use programming interfaces
First, load the SWF to a MovieClip, so that you can access thePlayer variable. Use loadMovie or MovieClipLoader.
var mc = createEmptyMovieClip("mc", getNextHighestDepth());
mc.loadMovie("xxx.swf");
var thePlayer = mc.thePlayer;
Then, use thePlayer variable to access the methods. To handle the control bar events, you can code like the following:
var listener: Object = new Object();
listener.onEvent = function(sender, type, name, info)
{
//sender is thePlayer
if (name == "onCuePoint") { //handle other events if you like
trace("onCuePoint Event: name=" + info.name + ", type=" + info.type + ", time=" + info.time);
}
}
thePlayer.AddListener(listener);
var mc = createEmptyMovieClip("mc", getNextHighestDepth());
mc.loadMovie("xxx.swf");
var thePlayer = mc.thePlayer;
Then, use thePlayer variable to access the methods. To handle the control bar events, you can code like the following:
var listener: Object = new Object();
listener.onEvent = function(sender, type, name, info)
{
//sender is thePlayer
if (name == "onCuePoint") { //handle other events if you like
trace("onCuePoint Event: name=" + info.name + ", type=" + info.type + ", time=" + info.time);
}
}
thePlayer.AddListener(listener);



