First I created another layer for actions. Gave instance name to shape and created Classic Dynamic text box in the same layer as where all the actions going to be and gave it instance name. Then entered this code to actions layer:
var score:Number =0
score+=1
scoreText.text="SCORE "+String(score)
trace("SCORE " +score)
aaa.addEventListener(MouseEvent.CLICK, fl_ClickToHide);
function fl_ClickToHide(event:MouseEvent):void
{
score+=1
scoreText.text="SCORE "+String(score)
trace("SCORE " +score)
}
And now every time you press on square shape score goes up by 1.
No comments:
Post a Comment