I have a class MyClass which has a setter "type" of type string and would like to conveniently set that property like this:
Text.SOMETHING = "myvalue" is a static constant. Ofcourse a constant NEVER changes. But why on earth is flex creating a binding for it:
private function _SomeClass_bindingsSetup():Array
var result:Array = ;
result = new mx.binding.Binding(this,
var result:* = (MyClass.SOMETHING);
return (result == undefined ? null : String(result));
instead of just doing this: result = MyClass.SOMETHING. It doesn't need the unnecessary Binding object. It seems flex is a little dumb to detect that the value in it is a constant. mxml is designed to make coding simpler by using xml constructs. But apparently i'm still forced to use the </fx:Script> construct to set the type. Plus the inconvenience to add an "id" to it to declare an unnecessary member variable just to set the type:
myid.type = MyClass.SOMETHING; //only workaround to avoid bindings??
Is there no other way to tell Flex that MyClass.SOMETHING is a constant and just replace it with the value instead of creating a useless slow binding?