# \[AS3\] Compilation Error

**URL:** https://forum.kirupa.com/t/as3-compilation-error/203422
**Category:** flash
**Created:** [October 10, 2006, 11:09pm UTC](https://forum.kirupa.com/t/as3-compilation-error/203422 "2006-10-10T23:09:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jpardoe](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jpardoe](https://forum.kirupa.com/u/jpardoe)
#### Post date: [October 10, 2006, 11:09pm UTC](https://forum.kirupa.com/t/as3-compilation-error/203422/1 "2006-10-10T23:09:33Z")

</div>

I’m trying my hardest to understand ActionScript 3, and I follow the tutorials all well and good, but when it comes to creating my own files, I keep hitting this error when compiling:

TypeError: Error #1007: Instantiation attempted on a non-constructor.  
at Main$iinit()

What on earth does it mean? what have I done wrong? my Main.as code is as follows:

```auto
package {
    import flash.display.*;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.ui.Mouse;
   
    public class Main extends MovieClip {
       
        private var cursorA:MovieClip = new MovieClip();
       
        public function Main() {
            cursorA = new cursorA();
            this.addChild(cursorA);
           
            stage.addEventListener(Event.MOUSE_LEAVE, cursorHide);
            stage.addEventListener(MouseEvent.MOUSE_MOVE, cursorFollow);
            Mouse.hide();
        }
       
        public function cursorHide(evt:Event):void {
            cursorA.visible = false;
        }
       
        public function cursorFollow(evt:MouseEvent):void {
            if (!cursor.visible) cursorA.visible = true;
            cursorA.x = stage.mouseX;
            cursorA.y = stage.mouseY;
            evt.updateAfterEvent();
        }
    }
}

```

I’ve got 2 movieclips in the library, and i’ve the linkage stuff (only referred to cursorA in the class though)
