4 Replies Latest reply on Mar 21, 2007 6:28 AM by James Newton, ACP

    Multiple Properties for Sprites

    BSpero Level 1
      Hey all,
      I don't think the title does my question justice. What I want to do is make a pull down menu of properties in my behavior, but have it be dependent on another selection right above it in the inspector. For instance, lets say I have a list of regions of the country, and another list of all the states. I want my behavior to show two pull down menus, but the second depends on what you choose in the first. If I chose "New England", then the second list would contain a list of the 6 New England states. Make sense? My problem is that I can't seem to retrieve a property from the sprite which running the getPropertyDescriptionList handler. Just to let you know what doesn't work...

        • 1. Re: Multiple Properties for Sprites
          johnAq Level 1
          GPDL doesn't work that way - it draws the whole dialog at the startand doesn't update depending on selections.

          You should look at creating your own dialog using MUI and runPropertyDialog instead of GPDL. I've read this works but not tried it. (search the help and archives for "runPropertyDialog")


          • 2. Re: Multiple Properties for Sprites
            BSpero Level 1
            John - thanks. Yeah, I tried some stuff with the runPropertyDialog, but it wasn't working for me. I know that it draws the dialog at the start, but was hoping someone had a workaround. I mean, once i set the property once, I would have hoped it could grab it, but alas no... I will probably just create two separate behaviors and grab the property once I assign it in the other...
            • 3. Re: Multiple Properties for Sprites
              Level 7
              I experimented with runPropertyDialog() and using the MUI xtra to build
              a selection dialog. It isn't bullet-proof but might serve as a starting
              point for further modification.
              < http://homepages.paradise.net.nz/snw/GPDL_MUI.zip>
              • 4. Re: Multiple Properties for Sprites
                James Newton, ACP Level 3
                Try the code below. It will not work in the Behavior Parameters Dialog (the modal window that pops up when you drop the behavior on a sprite). However, if you select the sprite, then open the Property Inspector at the Behaviors tab, you can first select the area, then select the state. If you change the area without making a new choice of state, then the previous state will remain chosen, but will now be associated with the wrong area.

                Does this help?