2 Replies Latest reply on Feb 5, 2008 2:52 AM by Xposure Interactive

    dropdown content

    Xposure Interactive
      I know this is a fairly basic question but it is twisting my melon. I want to use the content of a dropdown list, firstly to check that the user has selected and secondly to add it to a variable. I don't know how to what method i'm calling. It starts as a field with before the library behavious is attached but that doesn't work:

      else if member("dropDownOne").field = "Please select" then
      alert "Please select a job from the list. Expand the list by clicking on 'Please select' in the grey field"
      sprite(7).visible = TRUE


      gJob = member("dropDownOne").field

      Probably very obvious but I can't seem to be able to hunt out the answer anywhere.
        • 1. Re: dropdown content
          Level 7
          You can query the sprite for its current selection like so:
          lItems = sprite(x).myItemsList
          nSelected = sprite(x).mySelectedItem
          sSelected = lItems[nSelected]

          However, it would be safer to add a handler to the Dropdown List
          behavior allowing you to query it for its current selection. The above
          could serve as a starting point for this.
          • 2. Re: dropdown content
            Xposure Interactive Level 1
            quote:

            Originally posted by: Newsgroup User
            You can query the sprite for its current selection like so:
            lItems = sprite(x).myItemsList
            nSelected = sprite(x).mySelectedItem
            sSelected = lItems[nSelected]

            However, it would be safer to add a handler to the Dropdown List
            behavior allowing you to query it for its current selection. The above
            could serve as a starting point for this.




            Thanks Sean, that seems to work great. Do you know where I can find a tutorial on dropDowns and lists. I'm not sure what i've done so I would like to understand it a little better. You wouldn't know that I am a certified Java programmer and have been using Lingo for years!