flex 3: netconnection - how do i set a timeout?

2.6k Views Asked by At

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

There are 1 best solutions below

0
On BEST ANSWER

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.