A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How do I put any value I want in any textfield?

Hybrid View

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    7

    How do I put any value I want in any textfield?

    Hi!
    I know I'm thinking about this wrong, but I can't seem to get unstuck.

    I have two input text fields on the stage with variables respectively called inputField1, and inputField 2. I would like to put any value I want in either one of these.

    I tried to write a function:

    function showValue(value,field){
    numValue = Number(value); //value is coming from an external variable
    trace(numValue + 20); //traces back a sum
    field = numValue + 36;
    }

    showValue(dadAge,inputField1); //dadAge=18 is on the external .txt file

    So I want the number 54 showing up in inputField1. And of course it's not happening.

    Any help would be great!
    Thanks!

  2. #2
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    change this:
    Code:
    field=numValue+36
    to this:
    Code:
    field.text=numValue+36
    New sig soon

  3. #3
    Junior Member
    Join Date
    Feb 2003
    Posts
    7
    Thanks!

    I kept trying to track the variable name and not the instance name for some reason.

  4. #4
    Senior Member dudeqwerty's Avatar
    Join Date
    Mar 2005
    Location
    Bosnia
    Posts
    1,626
    no worries
    New sig soon

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