Question
Simple function parameter problem
I am going to have about 73 buttons on a couple of screens of
my flash module and I'd like to obviously be able to use the same
function to run all of them, but I keep getting errors. Here is the
code I'm using:
btn_1.addEventListener(MouseEvent.MOUSE_DOWN,goLink(1));
btn_2.addEventListener(MouseEvent.MOUSE_DOWN,goLink(2));
btn_3.addEventListener(MouseEvent.MOUSE_DOWN,goLink(3));
function goLink(num:Number) {
counter = num;
gotoAndStop(2);
}
I am trying to pass the number to the function so it will update the counter and load the right stuff on frame 2.
btn_1.addEventListener(MouseEvent.MOUSE_DOWN,goLink(1));
btn_2.addEventListener(MouseEvent.MOUSE_DOWN,goLink(2));
btn_3.addEventListener(MouseEvent.MOUSE_DOWN,goLink(3));
function goLink(num:Number) {
counter = num;
gotoAndStop(2);
}
I am trying to pass the number to the function so it will update the counter and load the right stuff on frame 2.
