A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: AS is driving me nuts

  1. #1
    Creative Addiction
    Join Date
    Nov 2001
    Location
    Newyork
    Posts
    91

    Question AS is driving me nuts

    Ok i am in a transition phase , i am trying to move from AS2 to AS#

    so far it has smooth sailing but now i see a storm building up ahead
    unless some can help me stear away

    ok here is the problem

    I have this code
    function question() {
    for (var i:int=0; i<questList.length(); i++) {
    var ansList :TextField = new TextField;
    ansList.type =TextFieldType.INPUT;
    ansList.border = true;
    ansList.x =(mytxt2.width+mytxt2.x)+10;
    ansList.y=mytxt2.y;
    questHolder.addChild(ansList);
    }
    }

    my question is how do i retrieve the data entered into those text fields by users and store it for later use
    any ideas??

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    You'll need to store references to those textfields so another function can find them later:

    PHP Code:
    var inputFields:Array = new Array();

    function 
    question() {
        for (var 
    i:int=0i<questList.length(); i++) {
            
    // ...
            
    inputFields.push(ansList);
        }
    }

    //  ..  

    trace(inputFields[3].text); 

  3. #3
    Creative Addiction
    Join Date
    Nov 2001
    Location
    Newyork
    Posts
    91
    Thanks a lot that worked!!!

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