Welcome, Guest
  • Author Topic: Set variable in flash from combobox  (Read 3704 times)

    anders Jönsson

    • Server what's that
    • *
    • Posts: 48
      • View Profile
      • 128bits
      • Email
    Set variable in flash from combobox
    « on: 05/03/04, 05:58 »
     ???

    Hello !

    I have this combobox in mx 2004 pro. It is populated from a database, and this works fine. What i wish to do now is set a variable depending on the choice one makes from the combobox. So if i choose a post from the list,  the variable "combo_choice" will be set to that same name.

    This way i could use that variable in a mail form.

    Hope i make sense :)

    Anders

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Set variable in flash from combobox
    « Reply #1 on: 05/03/04, 11:41 »
    Are you using MX or MX 2004?

    Jorge

    anders Jönsson

    • Server what's that
    • *
    • Posts: 48
      • View Profile
      • 128bits
      • Email
    Re:Set variable in flash from combobox
    « Reply #2 on: 05/03/04, 12:51 »
    MX 2004 Pro

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Set variable in flash from combobox
    « Reply #3 on: 05/03/04, 14:57 »
    Try this:

    [script]
    listenerObject = new Object();
    listenerObject.change = function(evt){
     combo_choice = evt.target.selectedItem.data //or label
      //do something with combo_choice
    }comboBoxInstance.addEventListener("change", listenerObject)
    [/script]

    Jorge

    anders Jönsson

    • Server what's that
    • *
    • Posts: 48
      • View Profile
      • 128bits
      • Email
    Re:Set variable in flash from combobox
    « Reply #4 on: 05/03/04, 16:07 »
    Works fine :)

    Thank You very much.

    Anders

    olga

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    Re: Set variable in flash from combobox
    « Reply #5 on: 03/04/05, 09:36 »
    Thank you, Jorge! You have also help me a lot!