I'm more then confused! I declare in a class some string constants: // MyConstants.as package { public class MyConstants { public static const My_CONST:String = "myConst"; } }
In one of my classes i declare a setter, which makes sure only allowed values can be processed, otherwise the class will throw an error. // MyClass.as package { public class MyClass { public function set property(value:String):void if (value != MyConstants.My_CONST) throw new Error("Ivnalid value passed: " + value); } } Now it turns out, that sometimes - in a nondeterministic behaviour - null is passed allthough i pass the constant. How can this be? It can't be a race condition since the fields should be instantiated at compile time and the can't be null... Any help? What am i missing? It would really be appreciated!