Flash Media Server Developer Documentation

Handle a stream not found

If a stream your application attempts to play is not found, a netStatus event is triggered with a code of NetStream.Play.StreamNotFound. Your netStatus event handler should detect this code and take some action, such as displaying a message for the user or playing a standard stream in a default location.

Note: Use the Streams sample, Streams.as, written in ActionScript 3.0.

Write the client code

 In your netStatus event handler, check for the StreamNotFound code and take some action:

private function onNetStatus(event:NetStatusEvent):void {
    switch (event.info.code) {
        case "NetStream.Play.StreamNotFound":
            trace("The server could not find the stream you specified"); 
            ns.play( "public/welcome");
            break;
        ...
    }