. :
var foo:Sprite = new Sprite();
foo.rotation = 20;
trace( foo["x"], foo["rotation"]);
:
var bar:String = "rotation";
trace( foo[bar] );
, , , ReferenceError, , , :
trace ( foo["cat"] );
, :
trace ( Sprite["cat"] ); // traces "undefined"
, :
if ( this[value] == undefined ) {
throw new ArgumentError("set city value is not applicable.");
}
EDIT:
, .
To do this, in order to work on your problem, you need to make the String value the same as the name const, for example:
public static const HALIFAX:String = "HALIFAX";
then you can use the query as described above and this will give you the desired result.
source
share