# Help with NetStatus

**URL:** <https://forum.kirupa.com/t/help-with-netstatus/283739>\
**Category:** flash\
**Created:** [March 10, 2009, 4:20pm UTC](https://forum.kirupa.com/t/help-with-netstatus/283739 "2009-03-10T16:20:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [March 10, 2009, 4:20pm UTC](https://forum.kirupa.com/t/help-with-netstatus/283739/1 "2009-03-10T16:20:36Z")

</div>

I am connecting to my gateway on AMFPHP and I cant seem to get a response back for when it connects. I know if I just do connect and then call one of my PHP classes it will call the database so it is obviously connecting. I dont want to call it until I know its connected though. Here is what I put:

```auto
function setUpNetConnection():void
{
	var nc = new NetConnection();
	nc.client = this;
	nc.objectEncoding=ObjectEncoding.DEFAULT;

	nc.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);
	nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorHandler);
	nc.connect("http://mysite.com/amfphp/gateway.php",false);

}
setUpNetConnection();

function netStatusHandler(event:NetStatusEvent):void
{
	trace(event);
}

function securityErrorHandler(event:SecurityErrorEvent):void
{
	trace(event);
}

```
