# Problem with NetStatusEvent

**URL:** <https://forum.kirupa.com/t/problem-with-netstatusevent/238487>\
**Category:** Uncategorized\
**Created:** [September 11, 2007, 9:37pm UTC](https://forum.kirupa.com/t/problem-with-netstatusevent/238487 "2007-09-11T21:37:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![test1](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@test1](https://forum.kirupa.com/u/test1)\
**Post date:** [September 11, 2007, 9:37pm UTC](https://forum.kirupa.com/t/problem-with-netstatusevent/238487/1 "2007-09-11T21:37:35Z")

</div>

I’m using amfphp for remoting and I’ve created a class that extends NetConnection to help out with this. I want to be able to track when connections are made and other events so I can play a cursor animation when things are loading. I’ve created an event listener for NetStatusEvent inside the class but it doesn’t seem to ever get triggered even though the code obviously makes a connection and works. Anyone else had a problem with this or am I doing something wrong?

```auto

package
{
    import flash.net.NetConnection;
    import flash.net.ObjectEncoding;
    import flash.events.NetStatusEvent

    public class RemotingConnection extends NetConnection
    {
        public function RemotingConnection()
        {
            addEventListener(NetStatusEvent.NET_STATUS, netStatus_Handler);
            objectEncoding = ObjectEncoding.AMF0;
            connect("/flashservices/gateway.php");
        }
        public function netStatus_Handler(e:NetStatusEvent)
        {
            trace(e.info.code);
        }
    }
}

```
