Custom components – order of parameters

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;
public var scale:Number;

will put the parameters in the order:
Item no:
XML tag:

iOS development with Swift - book: video course:

Tagged with:
Posted in Flash

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: