Today we were coding.
This is the code we used to make a movie clip symbol disappear on a click in your Hidden Object Games.
Each hidden object will have this code referring to the instance name in the actions layer.
objectTrash.onRelease = function() {
objectTrash._visible = false;
}
Press Control Enter to test your movie.
This is the code to add to your object to make the scoreDisplay Dynamic Text Field display the score when an object is clicked.
score = score + 1;
scoreDisplay.text = score;
Your code after these two steps will look like this
var score = 0 ;
objectTrash.onRelease = function() {
objectTrash._visible = false;
score = score + 1;
scoreDisplay.text = score;
}
Instead of 1 point you could make it (10)ten!
All of this code is found on the Wiki Project pages on the left hand column.
No comments:
Post a Comment