When I create a custom component, I define a property which is array that could accept values from the enumeration, see code below:
[Inspectable(type="Array", defaultValue="day, month", enumeration="day, week, decade, month, year")]
public var selectionMode:Array;
I would like to know how I can pass array of values to my component from MXML application that uses my custom component.
I expect that it should be something like:
<custom:component selectionMode="[day, year]" />
But it doesn’t work… Any idea?
inspectable metadata is just for code hinting purposes; and has nothing to do with the actual passing of data into the component.
To define a string of arrays in-line you need to use single quotes to enclose each string, like this:
Most people will not define an array in-line, though. They’d do so in ActionScript, like this:
In MXML they reference it like this: