Wednesday, 18 May 2011
Banner game score code.
The Writeing in the blue is the code which makes the score text go up every time the dot is clicked.
{
var score:Number =0
This creates the variable score which will be numeric and start a 0
scoreText.text="SCORE"+String(score)
This links to the score box, the "SCORE" is the writing in the box and the last bit is the link with the variable score.
dot.addEventListener(MouseEvent.CLICK, fl_ClickToHide_2);
function fl_ClickToHide_2(event:MouseEvent):void
{
score+=1
scoreText.text="SCORE"+String(score)
trace("SCORE")
This makes the score increase in count each time the dot is hit
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment