I have the following code to play a video from the main stage:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = this;
ns.play("/Volumes/MY BOOK/ Part 1.flv");
function onMetaData(info:Object):void {
trace(“MetaData Recieved”);
}
var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);
vid.x=48;
vid.y=52;
vid.width=500;
vid.height=337
function onPlayClick(evt:MouseEvent):void {
ns.resume();
}
function onPauseClick(evt:MouseEvent):void {
ns.pause();
function onBackClick(evt:MouseEvent):void {
ns.pause();
ns.seek(0);
}
playBtn.addEventListener (MouseEvent.CLICK ,onPlayClick);
pauseBtn.addEventListener(MouseEvent.CLICK,onPauseClick);
backBtn.addEventListener(MouseEvent.CLICK, onBackClick);
I have 5 flv videos that I want the user to choose from. I have 5 buttons on the main stage. What is the best way to program these buttons onRelease to play another video and for the controls (play,pause,stop) to control the video selected.
Any help would be greatly appreciated