stopping a netstream
I have managed to compile a script that pulls in an external video file, using netstream but now need to unload, or stop that video and start a new one. The code I have used to load is:
//creates an object in which to put metaData to be handled later
var customClient:Object = new Object();
customClient.onMetaData = metaDataHandler;
//establishes net connection to load video via web or local file
var nc:NetConnection = new NetConnection();
nc.connect(null);
//creates a stream for the video and locates file
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
ns.play("filmTest1.flv");
var myVideo:Video = new Video();
myVideo.attachNetStream(ns);
addChild(myVideo);
//positions video using metaData from video
function metaDataHandler(infoObject:Object):void {
myVideo.width = infoObject.width;
myVideo.height = infoObject.height;
}
I am really struggling with grasping this so any help would be greatly appreciated. I am using CS3, and all the tutorials are for CS4!!