MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 612

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

The following code traces cue points in an FLV file:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.onMetaData = function(metaProp:Object) {
trace("The metadata:");
traceMeta(metaProp);
// traceObject(metaProp, 0);
};
my_video.attachVideo(stream_ns);
stream_ns.play("http://www.helpexamples.com/flash/video/cuepoints.flv");
function traceMeta(metaProp:Object):Void {
var p:String;
for (p in metaProp) {
switch (p) {
case "cuePoints" :
trace("cuePoints: ");
//cycles through the cue points
var cuePointArr:Array = metaProp[p];
for (var j:Number = 0; j < cuePointArr.length; j++) {
//cycle through the current cue point parameters
trace("\t cuePoints[" + j + "]:");
var currentCuePoint:Object = metaProp[p][j];
var metaPropPJParams:Object = currentCuePoint.parameters;
trace("\t\t name: " + currentCuePoint.name);
trace("\t\t time: " + currentCuePoint.time);
trace("\t\t type: " + currentCuePoint.type);
if (metaPropPJParams != undefined) {
trace("\t\t parameters:");
traceObject(metaPropPJParams, 4);
}
}
break;
default :
trace(p + ": " + metaProp[p]);
break;
}
}
}
function traceObject(obj:Object, indent:Number):Void {
var indentString:String = "";
for (var j:Number = 0; j < indent; j++) {
indentString += "\t";
}
for (var i:String in obj) {
if (typeof(obj[i]) == "object") {
trace(indentString + " " + i + ": [Object]");
traceObject(obj[i], indent + 1);
} else {
612
Working with Images, Sound, and Video

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents