PDA

View Full Version : NetStream Status


The Little Guy
11-10-2008, 04:42 AM
I have this to play a NetStream

var vLoca:String = "http://flv.dudeel.com/flv/p2DAM3FX7tBrk.flv";
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
videoP.attachNetStream(ns);
ns.play(vLoca);

nc.addEventListener(NetStatusEvent.NET_STATUS,targ et);
function target(e:NetStatusEvent){
//trace(e.level);
if(e.info.code == "NetStream.Play.StreamNotFound")
trace("here");
}


I cant get this to work, I keep getting this error:

Error opening URL 'http://flv.dudeel.com/flv/undefined.flv'
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Play.StreamNotFound
at video3_0_fla::MainTimeline/video3_0_fla::frame1()

How do I check to see if the stream loaded successfully or not?

Paul Ferrie
11-10-2008, 07:49 AM
It loaded fine for me in my player.

Try this

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
videoP.attachNetStream(ns);
ns.play("http://flv.dudeel.com/flv/p2DAM3FX7tBrk.flv");
nc.addEventListener(NetStatusEvent.NET_STATUS,targ et);
function target(e:NetStatusEvent){
//trace(e.level);
if(e.info.code == "NetStream.Play.StreamNotFound")
trace("here");
}

The Little Guy
11-10-2008, 01:11 PM
I don't see any difference in the code other than you moving the string down.

I guess I should have mentioned, that that is a correct file. If you change the file name, such as remove a letter/number, there is no file that goes with it, so some sort of error message should have displayed, in my case I am doing a trace, but the code doesn't get to the trace when the file doesn't load successfully.

How can I fix that?