Flash flv metadata error #1069

Working with flvs I got that error

“Error #1069 onMetaData for flash.net.NetStream not found”

Here’s the fix.

var nc : NetConnection = new NetConnection();
nc.connect(null);
var ns : NetStream = new NetStream(nc);
var vid : Video = new Video();
 
var listener : Object = new Object();
 
// this is optional
//
listener.onMetaData = function(infoObject : Object):void
{
	trace("onMetaData");
	var key : String;
	for (key in infoObject)
	{
		trace(key + ": " + infoObject[key]);
	}
}
 
// this is optional
//
listener.onCuePoint = function(infoObject : Object):void
{
	trace("onCuePoint");
	var key : String;
	for (key in infoObject)
	{
		trace(key + ": " + infoObject[key]);
	}
}
 
// this is "the magic"
//
ns.client = listener;
ns.play("videos/vid2.flv");
vid.attachNetStream(ns);
addChild(vid);

So long

 

Leave a Reply

Formatting: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">