Flash CS3 Documentation |
|||
| Programming ActionScript 3.0 > Working with video > Using cue points | |||
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.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000266.html