The brackets are constructing the built-in actionscript Array.
Update: Using "as" return null, but compiles correction.
The only way I know how to do this is:
dynamic public class ExampleArray extends Array
{
// Constructor generated by FlexBuilder
public function ExampleArray(...parameters)
{
super(parameters);
}
}
w/
public var exampleArray: = new ExampleArray(1, 2, 3);
You'll have to add the dynamic
keyword to your class because the ...params is created at runtime.
ReferenceError: Error #1056: Cannot create property 0 on TestArray.
Adobe docs on the dynamic
keyword:
Specifies that instances of a class
may possess dynamic properties added
at runtime. If you use the dynamic
attribute on a class, you can add
properties to instances of that class
at runtime. Classes that are not
marked as dynamic are considered
sealed, which means that properties
cannot be added to instances of the
class.
If a class is sealed (not dynamic),
attempts to get or set properties on
class instances result in an error. If
you have your compiler set to strict
mode and you specify the data type
when you create instances, attempts to
add properties to sealed objects
generate a compiler error; otherwise,
a runtime error occurs.
The dynamic attribute is not inherited
by subclasses. If you extend a dynamic
class, the subclass is dynamic only if
you declare the subclass with the
dynamic attribute.
Note: This keyword is supported only
when used in external script files,
not in scripts written in the Actions
panel.