views:

387

answers:

1

Hi. Using flex 3, how do i set a timeout for a NetConnection?

code sample:

 nc=new NetConnection();
 nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
 rtmpNow="rtmpe://host/test/test1";         
 nc.connect(rtmpNow,fuid,gameName);
+1  A: 

Unless you plan to wait for a NetConnection.Connect.Failed, I believe you have to setup your own timeout checks.

Using a Timer object, you can check upon Timer.TIMER_COMPLETE whether or not you've received a NetConnection.Connect.Success in your checkConnect function.

Can't think of another way to do this.

Tegeril
awesome thanks!
ufk