0
votes

my problem is pretty hard to describe and to google for <_< so ill give it a try here.

ihave my main.as, char.as, enemy.as, classes

my main was the stage of course.... it worked pretty well, but now that my main is extern too, it wont be called anymore...

it calls: char, enemy(which is a sub class of char) and then the empty stage but it never calls my main.as which should be called first...

also it never calls any constructors...how can i tell flash to start with my main.as?

i hope you got it, the code is probably to much to post here :P

1

1 Answers

0
votes

If get you right.. you have to put super() calls to extended classes.

So for example in enemy class constructor:

public class enemy extends char {

  function enemy() {
    super(); // calls "char" class constructor
  }

}

and if you have params in your constructors:

public class enemy extends char {

  function enemy(param1: String, param2:String) {
    super(param1, param2); // calls "char" class constructor
  }

}

Overriding methods:

override public function doSome():void {

  super.doSome(); // call parent class
}

and to make flash start with your main class - select your FLA file stage in flash (professional) and from the right side panel (properties) set Class to your main class (for example: com.myApp.Main).