A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: form question

  1. #1
    Member
    Join Date
    Mar 2006
    Posts
    48

    form question

    I have a text field in which a number is coded by the user, this number goes by php to a database and retrieves information.

    That was easy. In the submit button: on (release)
    Code:
    {getURL("http://admin.cglship.com/tracking/ts2000tracking_DJG.php", "_blank", "GET");
    input = "";
    }
    and in the text field: var: input
    and in the timeline: method = "HA200";

    Now, the client needs 3 more fields and he wants me to use the same variable $input to retrieve the 4 numbers, separated by a coma.

    I dont know how to retrieve the information from the 4 fields, and added to the input variable... "input = "1, 2, 3, 4";

    Please you help is necessary!
    Thank you

  2. #2
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I think maybe using a LoadVars() object is what you may need to use.

    you can probably just use this:
    PHP Code:
    input textField1.text+","+textField2.text+","+textField3.text+","+textField4.text
    but here is an example of using sendAndLoad() to send some data to you PHP script..andthen execute (whateer) once the php script has been loaded/returns a response...if applicable)

    PHP Code:
    //create a new loadvars object
    var newData:LoadVars = new LoadVars();
    newData.inputNumbers textField1.text+","+textField2.text+","+textField3.text+","+textField4.text;

    //create a routine that executes when the text file is loaded
    newData.onLoad = function(success){
        if(!
    success){
            
    //if the text file was NOT found
            
    trace("PHP script Not Found");
        }else{
            
    //if text file was loaded properly
            
    trace("PHP script was found");
            
    //handle any return/echo from the php here as well
        
    }
    }
    //load the text file of choice
    newData.sendAndLoad("someFile.php"newData"POST"); 

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