|
|
|
#1 |
|
Junior Member
Join Date: Jan 2009
Posts: 1
|
ActionScript "3" Button help!!
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);
}
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);
}
What do i do wrong? I am very happy for all the answers!!! |
|
|
|
|
|
#2 |
|
Member
Join Date: Dec 2004
Posts: 53
|
In all of your event listeners you are assigning the function 'clickedButton', so each button takes you to frame 2. Change the EASY_BUTTON event listener's function to 'clickedButton3', the NORMAL_BUTTON's function to 'clickedButton4', and so on.
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|