Skip to main content
January 25, 2008
Question

Connection Disconnects Immediately

  • January 25, 2008
  • 1 reply
  • 274 views
I have flash client app built using CS3 with AS3. All I'm doing is:

// use mic for recording
var mic:Microphone = Microphone.getMicrophone();

var nc:NetConnection = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatusChange);

function someButtonClick() {
nc.connect("rtmp://servername/app_name/instance_name_1")
}

function onNetStatusChange(evt:NetStatusEvent):void {
if(nc.connected) {
var ns:NetStream = new NetStream(nc);
ns.attachAudio(mic);

// Start publishing to direcotry
ns.publish("audio_file", "record");
}
}

The swf is on my local machine. The FMS is running elsewhere. Looking at the FMS2 admin console, I see the bandwidth spike for a tiny second then drop back down to 0. The Clients total count also goes up by one but the Active clients remains at 0.

Is this somehow an authentication issue? I'm not seeing any clients get rejected though.

Any help would be greatly appreciated.
    This topic has been closed for replies.

    1 reply

    February 8, 2008
    your "nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatusChange)" dose not invoke the function of onNetStatusChange", hence, will not work for the net conn status checking.