EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 612

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
612 Working with Images, Sound, and Video
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 {

Table of Contents

Related product manuals