Flash Video Player in ActionScript 3
You can find a flash video player on almost any website these days, the market is white hot for it. The past few months I have been porting my knowledge from Actionscript 2 to 3.
There are 2 ways to play an FLV file in flash either with a FLVPlayback component or VIA a Video object streamed and controlled with NetConnect and NetStream. I prefer the later because I like to have more "control" over things, but this is a personal preference.
CODE
ACTIONSCRIPT:
-
var nc:NetConnection = new NetConnection();
-
-
nc.connect(null);
-
-
var ns:NetStream = new NetStream(nc);
-
-
var vid:Video = new Video(320, 240);
-
this.addChild(vid);
-
-
vid.attachNetStream(ns);
-
-
ns.play("http://www.mydomain.com/mymovie.flv");
-
-
ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);
-
-
function netstat(stats:NetStatusEvent) {
-
trace(stats.info.code);
-
}
-
-
-
var netClient:Object = new Object();
-
netClient.onMetaData = function(meta:Object) {
-
-
trace(meta.duration);
-
-
};
-
-
ns.client = netClient;

My name is Noah Everett. I live in Tulsa, OK. I started 