dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Number in text box

  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    30

    Number in text box

    hey, i am trying to make a banking system, i have a text box which is called totaltxt, the number is currently set to 0, i press a "50" button, and the total should be 50 right?....but im getting 050 instead, can any one help me out please?

    heres my code, i am using AS2 btw

    PHP Code:
        var bank:Number;
        
    bank.valueOf(totaltxt.text
        
    trace(bank bank 50);
        
    totaltxt.text valueOf(bank);
        
    this.gotoAndStop("start"); 
    thank you so much!

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    var bank:Number;
    bank = Number(totaltxt.text);
    trace(bank = bank+50);
    totaltxt.text = String(bank);

  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    30
    works like a treat, thank you dawsonk...i cant believe i forgot to put Number()

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center