Results 1 to 4 of 4

Thread: Using a variable from Flash combobox

  1. #1
    Join Date
    Jul 2009
    Posts
    122

    Using a variable from Flash combobox

    I'm sending program variable in a Flash form, I use a php script to send data.
    No problem for sending data open but things get tough for sending a variable in a multiple selection
    type Combobox (or listbox if you prefer).

    The idea is send the selected variable in the combobox to a hidden text field and then send it to the PHP script, I heard that it was possible and the easiest way to proceed. The code I have is as follows:

    name of the combobox: tpcombo
    name of text field or selected item is displayed: tp

    onEnterFrame = function () {tp.text = tpcombo.value };

    I only element that appears by default or reference "level" of the item ie _level0.tp

    Help me how can I send this variable from Flash combobox!

  2. #2
    Join Date
    Nov 2008
    Posts
    996

    Re: Using a variable from Flash combobox

    I do not remember too how it happened but it is very messy to use an enterFrame... You should use the event "OnChange" or "change" (Event that fires whenever the value of the target object will change). Otherwise, I do not get too much interest to go through an invisible textfield. Otherwise the property .selectedIndex which appears to return the selection rather than .value.

  3. #3
    Join Date
    Jul 2009
    Posts
    122

    Re: Using a variable from Flash combobox

    The interest is that I tried to program a script that sends the variable in a Formmail Php and its a mess. I thought (maybe wrongly) that it is easier to do preliminary work in Flash with a reference variable in a text field. It will be easier and easier to send a predetermined variable and already dealt with the Flash.

    In any case I am lost, I was told he had to go through a LoadVars and I can not. I'll be grateful if you could give me a routine that might work with other things that I gave you earlier.

  4. #4
    Join Date
    Nov 2008
    Posts
    996

    Re: Using a variable from Flash combobox

    Yes, it's no worse to verify by flash before handling in PHP, I do not usually use the ComboBox. Yes to use a LoadVars and the method, it depends what you want. If you just want handling and then enough PHP, or PHP will love sent back to Flash. For handling of no return, use a loadVariablesNum ... (in GET or POST as your choice, it is preferable to use POST ...).

    I am not sure but it will give something like this:

    Code:
      var myForm: LoadVars = new LoadVars();
      myForm.selectionComboBox = tpcombo.selectedIndex;
      myForm.loadVariablesNum ("myPageHandling.php", 0, "POST") / / I send everything to PHP
    In PHP, you retrieves the variable via $ _POST['selectionComboBox'] ...

Similar Threads

  1. Need Help With ComboBox
    By Reyas in forum Software Development
    Replies: 1
    Last Post: 29-04-2012, 12:53 PM
  2. Use of combobox in script
    By Martien in forum Software Development
    Replies: 3
    Last Post: 15-01-2010, 11:58 AM
  3. Combobox and Text value
    By HarshaB in forum Software Development
    Replies: 5
    Last Post: 09-11-2009, 07:16 PM
  4. Replies: 2
    Last Post: 28-08-2009, 07:51 PM
  5. Replies: 3
    Last Post: 25-04-2009, 11:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,078,737.61902 seconds with 16 queries