Hi
I am using dynamic text to increment my value “dtext”.
There are 3 buttons on the stage. When you click on one, it disappear and the counter becomes 1, ect.
The counter works, but there is something wrong with my if statement, because it never goes to frame 131.
My code:
var counter = 0;
dtext.text = counter;
if(counter < 3)
{
ball1_btn.addEventListener(MouseEvent.CLICK, gotoball1);
function gotoball1(event:MouseEvent):void
{
ball1_btn.alpha = 0;
dtext.text = ++counter;
}
ball2_btn.addEventListener(MouseEvent.CLICK, gotoball2);
function gotoball2(event:MouseEvent):void
{
ball2_btn.alpha = 0;
dtext.text = ++counter;
}
ball3_btn.addEventListener(MouseEvent.CLICK, gotoball3);
function gotoball3(event:MouseEvent):void
{
ball3_btn.alpha = 0;
dtext.text = ++counter;
}
}
else
gotoAndStop(131);
Can someone please help me?
Thanks