View Full Version : Actionscript 3: Textfield Variables

07-17-2012, 01:02 AM
Hey there, I have having a little trouble with my project. I have a textfield which I have given the instance name of money. For the coding, I have this:

var money:int = 10;
money.text = "$" + money;

I want the variable money to be 10. For the text output, I want it to show $10. This isn't working though. I keep getting the error:
1151: A con flict exists with definition money in namespace internal.
Source: var money:int = 10;

Can you please help me figure out what it is I did wrong? Any help is appreciated.

07-17-2012, 09:46 AM
If "money.text" is a label, then this should work.

var money:int = 10;
money.text = "$" + money.toString();