Moyea Web Player Pro Tutorial
- How to use programming interfaces
First, load the SWF to a Movie Clip, so that you can access the Player variable. Use loadMovie or MovieClipLoader.
var mc = createEmptyMovieClip("mc", getNextHighestDepth());
mc.loadMovie("xxx.swf");
var thePlayer = mc.thePlayer;
Then, use the Player 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);