Forum Moderators: open

Message Too Old, No Replies

List of compile time constants

         

visionmonster

4:07 pm on Aug 10, 2007 (gmt 0)

10+ Year Member



in Flex builder 2 AS3

I got this error 1046: Type was not found or was not a compile-time constant

with this line of code

private function test(a:Array = [100,100],s:String="hello"):void{

}

I assume it means i can't set a default value for an Array for optional values.

I could set it to a:Array=null and then test for a null value and set it appropriately which would solve the issue, but seems like an extra step.

It doesn't work for Object either, so what i was wondering, is there a list of available Types that can be used with the optional parameters i.e uint, int, Number, String, Boolean with useful default values.

thanks for any additional information on

--matt