dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How do i add numbers with textboxs?

Hybrid View

  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    359

    How do i add numbers with textboxs?

    hi there,

    im having trouble adding numbers together. I keep getting this result: 50505050 etc

    this my code:




    i(50);
    function i(count) {

    var myNumber:Number = Number(count);

    counter.txt_counter.text = count + counter.txt_counter.text;
    }


    im sure its a simple one,



    thanks
    FlashX

    ________________________
    The mind lies, it only hears what it wants to hear.

  2. #2
    Junior Member
    Join Date
    Jul 2010
    Posts
    12
    easy:

    counter.text_counter.text = Number(count) + Number(counter.txt_counter.text);

    You may have to wrap the whole right side in a String(), but I don't think you do.

  3. #3
    Senior Member
    Join Date
    May 2002
    Posts
    359
    ah you rock!

    thank you, that worked
    FlashX

    ________________________
    The mind lies, it only hears what it wants to hear.

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