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++) {
indent= "\t";
}
for (var i:String in obj) {
if (typeof(obj[i]) == "object") {
trace(indent " " + i + ": [Object]");
traceObject(obj[i], 1);
} else {
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...