Wednesday, 18 May 2011

Scoring system on flash

Today we did a short tutorial on how to make a score board come up and start scoring every time you click the target we used an exsisting animation with the random aprearing dot, we had to create and actions layers and begin to code for this score board to work, we went into code snippets and selected click to go to webpage and simpley changed the coding to


dot2.addEventListener(MouseEvent.CLICK, hitdot2);

function hitdot2(event:MouseEvent):void

to make the scoring work and come up on the screen u first create a text box the u put in this bit of coding


{
score+=1
scoreText.text="SCORE "+String(score)
dot2.gotoAndPlay (25)
trace("SCORE")
}


(((All in all this is the final coding you should have ;)))


var score:Number =0

scoreText.text="SCORE "+String(score)

dot2.addEventListener(MouseEvent.CLICK, hitdot2);

function hitdot2(event:MouseEvent):void
{
score+=1
scoreText.text="SCORE "+String(score)
dot2.gotoAndPlay (25)
trace("SCORE")
}

No comments:

Post a Comment