The following example uses a simple for..in loop to iterate over each of the properties in the onCuePoint callback handler's infoObject parameter and trace a message when cue point data is received:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = this;
ns.play("video.flv");
var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);
function onCuePoint(infoObject:Object):void
{
var key:String;
for (key in infoObject)
{
trace(key + ": " + infoObject[key]);
}
}
The following output appears:
parameters: name: point1 time: 0.418 type: navigation
This code used one of several techniques to set the object on which the callback method was invoked. You can use other techniques; for more information, see Writing callback methods for onCuePoint and onMetaData.