Welcome, Guest
  • Author Topic: Saving data to txt file with combobox  (Read 2109 times)

    ferx17

    • Server what's that
    • *
    • Posts: 1
      • View Profile
      • Email
    Saving data to txt file with combobox
    « on: 01/20/09, 16:18 »
    Hello, Im trying to write into a text file with the PHP method but instead of using data form a text field, using one from a Combobox

    what should i do after this part?
    Code: [Select]
    submit.addEventListener("mouseDown",sendData);
    function sendData(evt:Event){

    //Using PHP
    var myData:URLRequest = new URLRequest("save.php")
    //Using CFM
    //var myData:URLRequest = new URLRequest("save.cfm")
    myData.method = URLRequestMethod.POST
    var variables:URLVariables = new URLVariables()
    variables.Text = Combobox.selectedItem.label

    it doesnt seem to be retrieving the info to send it to the PHP
    « Last Edit: 01/20/09, 17:42 by ferx17 »

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Saving data to txt file with combobox
    « Reply #1 on: 01/21/09, 03:53 »
    see loading and saving tutorials.
    Depending on the amount of data and update frequency, use either LoadVars object, or AMFPHP.
    happy flashing
    8)
    Ronald

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Saving data to txt file with combobox
    « Reply #2 on: 01/21/09, 05:54 »
    If the field to capture is

    Combobox.selectedItem.label

    Use the instance name of the combobox, and don't use Combobox since is the name of the class and could give problems. Since selectedItem is a setter/getter, use Combobox.selectedIndex = 0 to select your first entry as default, if not you get a runtime error

    Jorge