Fixing errors

cant get rid of my errors…can someone help…

package {

import flash.display.MovieClip;
import flash.utils.Timer;
import flash.ui.Mouse;
import flash.events.*;

public class main extends MovieClip {

         public var myTimer:Timer;
         public var myEnemy:Array = new Array();

         public function main() {
                 trace("TEST");
                 myButterfly = new butterfly4();
                 addChild(myButterfly);
                 Mouse.hide();
                 myButterfly.startDrag(true);
                 myTimer=new Timer(60);
                 myTimer.addEventListener(TimerEvent.TIMER,moveEnemy);
                 myTimer.start();
                 for (var i=0; i < 20; i++) {
                         myEnemy*=new enemy3();
                         this.addChild(myEnemy*);
                         myEnemy*.x=Math.random() * 1024;
                         myEnemy*.y=Math.random() * 768;
                         for (var i=0; i < 20; i++) {
                           myEnemy*.x += 1
                           myEnemy*.y += 1
                         myEnemy*.addEventListener(MouseEvent.CLICK,clickMe);
                         }
                 }
        
         public function moveEnemy(e:TimerEvent) {
                 for (var i=0; i < 20; i++) {
                           if (butterfly4.hitTestObject(myEnemy*)){
                                    var myEnd = new ending();
                                       this.addChild(myEnd);
                         }
                 }
         }
         public function clickMe(e:MouseEvent) {
        
         }
}
}

What are your errors?

Off the top of my head – I haven’t the time to look carefully at your code unfortunately – I do believe that the name of your class (and constructor) have to begin with a capital letter, i.e., “Main” not “main”.

Capitalizing class names is considered a “best practice” but it isn’t necessary and won’t throw errors… The first thing that jumps out at me is that myButterfly doesn’t seem to be declared anywhere… Try:

[AS]var myButterfly:butterfly4 = new butterfly4();[/AS]

and see what happens next…