I just switched from Action Script 2 to Action Script 3 to test a bit. But now I am sitting firmly on a really annoying problem.
I was going to make a small game and to do so, I created a Start button and then 3 buttons to choose which level to begin on. simply made a text in frame "1" and the converted it into a button with <Instance name> START_BUTTON. in frame 1 This is the code:
Code:
stop();
START_BUTTON.addEventListener(MouseEvent.CLICK, clickedButton);
function clickedButton (event:MouseEvent)
{
gotoAndStop(2);
}
on frame "2" so I crerated 3 buttons with <Instance name> EASY_BUTTON, NORMAL_BUTTON and HARD_BUTTON. The code to this is:
Code:
EASY_BUTTON.addEventListener(MouseEvent.CLICK, clickedButton);
function clickedButton3 (event:MouseEvent)
{
gotoAndStop(3);
}
NORMAL_BUTTON.addEventListener(MouseEvent.CLICK, clickedButton);
function clickedButton4 (event:MouseEvent)
{
gotoAndStop(4);
}
HARD_BUTTON.addEventListener(MouseEvent.CLICK, clickedButton);
function clickedButton5 (event:MouseEvent)
{
gotoAndStop(5);
}
when I click on START_BUTTON it takes me from frame "1" to frame "2" and thats great. BUT on frame "2" none of the three buttons is working. I can see that there are buttons when I drag the mouse over them but nothing happens when I click on em. Ofcourse I have done something on frame 3,4,5 so the problem is not that the buttons has none frame to go to.
What do i do wrong?
I am very happy for all the answers!!!