# Help with classes: 1046 type not found

**URL:** <https://forum.kirupa.com/t/help-with-classes-1046-type-not-found/306532>\
**Category:** flash\
**Created:** [March 17, 2010, 3:41am UTC](https://forum.kirupa.com/t/help-with-classes-1046-type-not-found/306532 "2010-03-17T03:41:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chimeara](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@Chimeara](https://forum.kirupa.com/u/Chimeara)\
**Post date:** [March 17, 2010, 3:41am UTC](https://forum.kirupa.com/t/help-with-classes-1046-type-not-found/306532/1 "2010-03-17T03:41:07Z")

</div>

I have a pre loader for my animation that uses this code:

```auto
this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void{

var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;

//bar_mc.scaleX = loaded/total;
Load_Amount.text = "[" + Math.floor((loaded/total)*100)+ "%]";

if (total == loaded){
	Load_Amount.text = "[CLICK]";
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
}

}

```

and :

```auto
Exit_Loader.addEventListener(
  MouseEvent.MOUSE_UP,
  function(evt:MouseEvent):void {
   play();
  }
);

```

this works fine, until i try to add a class to the .fla, then it gives me errors:

1046: Type was not found or was not a compile-time constant: Event. for

```auto
function loading(e:Event):void{

```

why is this happening? I set the document class to ‘Main’ and i have ‘Main.as’ in the same directory as my .fla , removing the document class removes the error…
