3 Replies Latest reply on Jan 15, 2007 6:13 PM by Lukewig

    Changing the labels and associated textbox on the fly

    Atul_Saxena
      Hi Everyone,

      I have a small problem. I have a drop down. I want to change the labels and textboxes associated with it based on the item selected in the drop down....

      Any sort of help will be appreciated
      Thanks in advance....
      Atul Saxena
        • 1. Re: Changing the labels and associated textbox on the fly
          Level 7
          Atul Saxena wrote:

          > I have a small problem. I have a drop down. I want to change the labels and
          > textboxes associated with it based on the item selected in the drop down...

          Hi Atul,

          I assume you have a drop down menu correct? Do you want text that's displayed in
          another sprite to change when you select an item in the drop down menu?

          You'd need to give more info on how you're setting up your application so people
          who respond can give you information more suited to what you actually want to
          do.

          For now, I'll suggest looking at menu Xtras. They're generally easy to use and
          quick to set up. One that I use which I'd recommend is the SarMenu Xtra:
          http://www.starsoftmultimedia.com/xtras/StarMenu/
          There many other menu Xtras available.

          regards
          Dean

          Director Lecturer / Consultant
          http://www.fbe.unsw.edu.au/learning/director
          http://www.multimediacreative.com.au


          • 2. Re: Changing the labels and associated textbox on the fly
            Atul_Saxena Level 1
            I have drop down which is basically a bit map and i have attached a combo box beheviour to it. So now when i select a perticular item from the combobox(drop down) then the different member like label and Text fields shoud get changed.

            For example if I have these item in the drop down (Item 1, Item 2). Now when i select "Item 1" the lablels and the associated text field member should be displayed on the stage i.e. if Item 1 is selected then I should get a First name Label and a First name textbox. Also
            if i select "Item 2" then the label should change to Full Name and a text box member which will hold the value of the Full Name.

            Also tell if it is possible without using of any xtra.

            I hope that make sense...
            Thanks..

            Basically
            • 3. Re: Changing the labels and associated textbox on the fly
              Lukewig Level 1
              Hi,

              It is all possible without an Xtra, but it is hard to give you any specific feedback without some idea of what 'combo box behaviour ' are you using.... but basically, you want to write a handler like this:

              on ComboboxItemChanged (selectedPos)
              -- determine the label text based on which item selected
              LabelText = ListOfLabels.getAt(SelectPos)
              -- determine the display text based on which item selected
              displaytext = ListOfText.getAt(SelectPos)

              -- set the cast member texts
              member("label").text = LabelText
              member("Textbox").text = displaytext

              -- go to the frame displaying them?
              go to "SomeMarker"
              end

              Incidentally, if you do decide to use an Xtra - check out OS Controls from openspark.com. The are cross-platform

              -- Luke