I just stumbled across a little type conversion quirk within Flex. I haven’t tested this in-depth, so I may yet be proven wrong.
However….check this out:
var someVal:string = “true”; var bool:Boolean; bool = someVal as Boolean; // bool == false; bool = someVal; // bool == true;
If you try to explicitly cast a string to Boolean, the casting appears to fail silently, leaving the Boolean with its default value of false.
However, if you leave it to the runtime to convert, the conversion works fine.
Ya learn something new every day!