# NetStatusEvent not being found Please help!

**URL:** <https://forum.kirupa.com/t/netstatusevent-not-being-found-please-help/240966>\
**Category:** Uncategorized\
**Created:** [October 8, 2007, 10:42pm UTC](https://forum.kirupa.com/t/netstatusevent-not-being-found-please-help/240966 "2007-10-08T22:42:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ella\_romanos](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@ella\_romanos](https://forum.kirupa.com/u/ella_romanos)\
**Post date:** [October 8, 2007, 10:42pm UTC](https://forum.kirupa.com/t/netstatusevent-not-being-found-please-help/240966/1 "2007-10-08T22:42:11Z")

</div>

I have a problem with the following code, which is in an external AS file:

* * *

import flash.events._;  
import [flash.net](http://flash.net)._;

class myClass extends MovieClip {  
private var nc:NetConnection;

private function onLoad(){  
init();  
}

private function init():Void{  
serverPath = “\<aServerpath\>”;  
nc = new NetConnection();  
nc.addEventListener(NetStatusEvent.NET\_STATUS, netStatus);  
nc.addEventListener(SecurityErrorEvent.SECURITY\_ERROR, netSecurityError);  
nc.connect(serverPath);  
}

private function netStatus(event:NetStatusEvent):Void {  
switch (event.info.code) {  
case “NetConnection.Connect.Success”:  
trace(“Connection to server " + serverPath + " succeeded”);  
break;  
case “default”:  
trace(“Connection to server " + serverPath + " failed”);  
break;  
}

```
    }
    
private function netSecurityError(event:SecurityErrorEvent):void {
    trace("netSecurityError: " + event);
}

```

## }

the error says that ‘the class or interface NetStatusEvent could not be found’ (and the same for SecurityErrorEvent)

Does anyone know why this is? It’s driving me crazy!  
Thanks in advance.
