title: Multiple (different) objects from one constructor in Flash/AS3
body: <p>I have to create a game in flash for school. I'm kind of stuck, however. I know an approach that might work, but I'm wondering if there isn't a way to do it all-in-one. Here goes.</p>
  
  <p>I have a start screen with 4 buttons. These buttons all link to different levels, and they all have a different image. Let's call them btn1 btn2, .. btn4. I made a class called 'GameButton':</p>
  
  <pre><code>package 
  {
      import flash.display.SimpleButton;
  
      public class GameButton extends SimpleButton
      {
          public function GameButton()
          {
                 // x= 
                 // y=
          }
      }
  }
  </code></pre>
  
  <p>I initiate this in my Main class:</p>
  
  <pre><code>    public var btn1:GameButton;
  
      public function MainAteam()
      {
  
          btn1 = new GameButton();
          addChild(btn1);
          btn1.addEventListener(MouseEvent.CLICK, startGame1);
      }
  </code></pre>
  
  <p>My first button is linked with the GameButton class and gets put on my stage by addChild in my Main class. Now, of course, GameButton will ALWAYS show the image of the button I linked it with. I was wondering if there is a way to use ONE constructor but use different images.. Perhaps with an argument in the constructor function. For example so I could do</p>
  
  <pre><code>btn2 = new GameButton(2)
  </code></pre>
  
  <p>And it then adds a button with the image for button 2. I'm confused and I don't know if this is even possible.. </p>
  
  <p>The other approach I see is to create four different button classes and link each of them to a different button, but then I'd have to create for files for something really simple, which seems like a lot of trouble for well.. just adding a button.</p>
  
  <p>It's been a while since I worked with AS3. Hopefully someone can help me out here. Thanks in advance.</p>
  
  <p>EDIT:
  I just realised this might be a stupid question. However, isn't there a way to like.. make a constructor for an empty button, then maybe add a symbol to it? Not sure. Really confused, I appreciate any help.</p>