Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Actionscript 3: Textfield Variables

    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.

  • #2
    New to the CF scene
    Join Date
    Jun 2012
    Location
    Philippines
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If "money.text" is a label, then this should work.

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


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •