Hi,
It would be great if you could give a short summary of what you've already tried and what you have, 'cause we could then help you out with what you've already got ;)
but I'm going to try this in a simple way. Make first a Dynamic Textfield, give it an instance name of something like,
score_txt, then click on your Frame and press F9 to open Actions panel, and type something like this:
Code:
score = 0;
onEnterFrame = function(){
score++;
score_txt.text = score;
}
I am assuming you already have an onEnterFrame function, so just copy what's inside the onEnterFrame function in my code, and paste it in yours. What we essentially do, is to declare a variable named
score with the starting value of 0, and then using onEnterFrame, which executes a set of codes over and over again, we keep increasing the score variable as time passes, and at the same time we set the textfield's text as the value of the score variable, so that we may see the value on screen :)
If you have difficulties with variables, we can do this even simpler. Instead of giving your Dynamic Textfield an INSTANCE name, instead, give it a Variable name (find the field Var: in the properties panel after selecting your textfield), and type in there something like,
score_txt. Then on your Frame, press F9, and type this in the actions panel:
Code:
score_txt = 0;
onEnterFrame = function(){
score_txt++;
}
Now, we assign the value of the variable score_txt as the value of our textfield, so it's automatically going to show that value. Then, we just keep increasing it by adding +1 to the value, and keep doing that over and over again using onEnterFrame function.
If you find anything confusing, feel free to ask me about anything regarding this :) I hope this helps :D