I have three different buttons. When you click one of the buttons, it is supposed to activate the stageSelect function, which should then output the button's number.
But when I do that, I get the error in the title. What am I doing wrong here?
package {
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.events.MouseEvent;
import flash.ui.Mouse;
public class MenuScreen extends MovieClip {
public function MenuScreen() {
Mouse.show();
selectGrass.addEventListener(MouseEvent.CLICK, stageSelect, 1);
selectDirt.addEventListener(MouseEvent.CLICK, stageSelect, 2);
selectGravel.addEventListener(MouseEvent.CLICK, stageSelect, 3);
}
public function stageSelect(stageID:Number) {
trace(stageID);
}
}
}