A pain with parameters in custom components is that the order is set to alphabetical, and there’s nothing you can do about it. It’s a pain, because you might want better consistency to your parameters in different components, or to put the higher priority parameters first…
I’d already resigned myself to this fact when I happened upon a comment in a six year old blog post with a sneaky solution.
Add the unicode character \u200b to a parameter and it will come before the others. Add two of the same unicode characters and it will come before that one. And so on. It’s just like aaaa at the beginning of the phone book.
[Inspectable(name="\u200B\u200BItem no:")] public var itemNo:int; [Inspectable(name="\u200BXML tag:")] public var xmlTag:String; [Inspectable(name="Scale:")] public var scale:Number;
will put the parameters in the order:
Leave a Reply