getProperty( ) Global Function | Flash 5 |
retrieve the value of a movie clip propertyFlash 4; deprecated in |
An expression that yields a string indicating the path to a movie clip. As of Flash 5, this can also be a movie clip reference, because movie clip references are converted to paths when used in a string context.
The name of the built-in property to retrieve. Must be an identifier, not a string (e.g., _x, not "_x").
The value of movieClip's property.
The getProperty( ) function retrieves the value of one of a movie clip's built-in properties. Though getProperty( ) was the only way to access object properties in Flash 4, the dot and [ ] operators are the preferred property-access tools as of Flash 5.
Each of the following getProperty( ) invocations retrieve the values of the _x property of a movie clip, named ball, on the main movie timeline:
getProperty(ball, _x); // Relative movie clip reference getProperty(_root.ball, _x); // Absolute movie clip reference getProperty("ball", _x); // Relative path in string getProperty("_root.ball", _x); // Dot path in string getProperty("/ball", _x); // Slash path in string
The following code shows similar property access using the preferred dot and [ ] operators:
ball._x; _root.ball._x; ball["_x"]; _root["ball"]["_x"]; _root["ball"]["_x"];