This content has been marked as final. Show 3 replies
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?
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?
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:"",
The fix was simple, make the default type match the format specified.
Any symbol will do, #default:#default for example.