Completion of FLV - Video Object and FMS

I am creating a simple video player with the video object but I am using Flash Media Server.

I can not figure out how to determine the completion of the FLV. Can anyone help?

Here is my code:



var nc:NetConnection = new NetConnection();




nc.onStatus = function(info)
{
	trace("#NC# " + info.code);
	

	
}
function init()
{
	
	ns = new NetStream(nc);
	vid.attachVideo(ns);
	ns.OnStatus = function(info)
	{
		trace("#NS# " + info.code);
	}
	
	
	_root.loadCurrentCC("bunnel");

	ns.play("Welcome");
	
	
}

play_btn.onPress = function () {
	init();
	play_btn.gotoAndPlay(2);
	if (_root.pageFlipOn == true){
		_root.pageFlipOn = false;
		
	}else{
		_root.pageFlipOn = true;
		_root.loadCurrentCC("blank");
		
		
	}trace(_root.pageFlipOn);
	
	
}

pause_btn.onPress = function () {
	ns.pause();
}

var id:Number;

ff_btn.onPress = function():Void {
  var dest1:Number = ns.time;
  id = setInterval(function():Void {
    ns.seek(dest1 += 2);
  }, 100);
}
ff_btn.onRelease = function():Void {
  clearInterval(id);
}


rw_btn.onPress = function():Void {
  var dest:Number = ns.time;
  id = setInterval(function():Void {
    ns.seek(dest -= 2);
  }, 100);
}
rw_btn.onRelease = function():Void {
  clearInterval(id);
}


nc.connect("rtmp://wdmdfms-live.uwsp.edu/DESTREE_J/");