A follow-up to my previous question.
I have a button on my stage, which has a class called Game1 (I didn't define this class, just linked it like Juan answered to my other question). The button has 'GameButton' as base class, which at the moment contains some simple x, y statements.
All my buttons will have a dummy class 'GameX' and a base class of GameButton; this way they inherit from the base class, but they can still have a different graphic.
I have a main class which contains code to add this button:
public class MainAteam extends MovieClip
{
public var btn1:Game1;
public function MainAteam()
{
btn1 = new Game1();
addChild(btn1);
btn1.addEventListener(MouseEvent.CLICK, startGame1);
}
// startGame 1 function here
}
Now, I would like to be able to give x, y values through parameters so I can place each button on a different spot. However, when I try new Game(5,5) and I put the following in the GameObject constructor:
package
{
import flash.display.SimpleButton;
public class GameButton extends SimpleButton
{
public function GameButton(startX:Number, startY:Number)
{
x = startX;
y = startY;
}
}
}
I get the following error:
1203: No default constructor found in base class GameButton
I don't really know how to fix this, since I let Flash define the GameX classes for me (I suppose they're just empty) and use the base class to set some properties. If I just put x=5; y=5, it works fine. Thanks a lot.
