3 Replies Latest reply on Nov 5, 2008 9:56 PM by Newsgroup_User

    getPropertyDescriptionList bug or not?

    Level 7
      In a behavior I have:

      on getPropertyDescriptionList
      description = [:]
      addProp description,#test, [#default:void, #format:#symbol,
      #comment:"test"]
      return description
      end


      I tried setting the value of test to x and #x (in the dialog box) but in
      either case

      put ilk(sprite(1).test)
      -- #string

        • 1. Re: getPropertyDescriptionList bug or not?
          James Newton, ACP Level 3
          I'm guessing that when you first created this behavior, the #test property had the format #string. You then attached it to a sprite, gave #test a string value... and then changed your mind about the format. Director will have recorded a string value for the #test property, and (for some reason that some might call a bug) is continuing to believe that #test should still be a string.

          Try this: delete the behavior from the sprite, then drop it back onto the sprite. Does this clear up the issue?
          • 2. Re: getPropertyDescriptionList bug or not?
            Level 7
            I tried this with a brand new file where the format was always a symbol
            but see the same results. I have version 8.5 (I know, quite old). I
            guess its a bug. Does anyone see this in newer versions?
            • 3. Re: getPropertyDescriptionList bug or not?
              Level 7
              OK, it's another case of user error!

              The problem is that in my property description, the default value type
              didn't match the format type.

              addProp description,#test, [#default:void, #format:#symbol, #comment:"test"]

              I didn't care about the default, because I was always going to be
              setting the value when the parameters dialog box displayed. I used void
              so the field would start empty. However this seems to have the effect of
              overriding the #format of the property and setting the type of the
              property to #string. The same problem occurred when using #default:"",
              #default:"abc", #default:123.

              The fix was simple, make the default type match the format specified.
              Any symbol will do, #default:#default for example.