Topic: need help adding to a Variable

In my flash program I am trying to add 1 to a variable that has 01, to make it 02 and so on when a button is pressed. I can’t figure out what to put in my EventListener's function to make this happen. Can anybody help me?

Thank You,

Cameron

Re: need help adding to a Variable

Hello,

You will need to track the numerical value in a variable and then use that to produce a string version with your added "0", for example:

var my_counter:Number = 0;
my_counter++;

//build string
var display_str:String = String("0"+my_counter);

Hope that helps point you in the right direction.

Cheers.