Hey, im having some trouble with my code
I'm trying to make a object be worth points. Here is the code im using, but it doesnt make the score increase, it just makes the 0 vanish after clicking on the item. Then you click on the item again and it says 00, then nothing, then 0 and repeat. Any ideas?
----------------------------------------------------
var currentScore:int;
init(); // this line goes directly beneath the variables
function init():void{ // call once to set everything up
currentScore = 0; //start with 0 score
MoneyBtn.addEventListener(MouseEvent.CLICK, addScore ); // clicking on +1
}
function updateScoreText():void
{
scoretxt.text = (""+ currentScore); // set the text property of the txtScore
trace("Score text updated");
}
updateScoreText(); // finally, update the text field
function addScore(e:MouseEvent):void{
currentScore += 25; // add points to the score
updateScoreText(); // update the textfield
}
