Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript language elements > Operators > . dot operator | |||
object.property_or_methodinstancename.variable instancename.childinstanceinstancename.childinstance.variable
Used to navigate movie clip hierarchies to access nested (child) movie clips, variables, or properties. The dot operator is also used to test or set the properties of an object or top-level class, execute a method of an object or top-level class, or create a data structure.
Availability: ActionScript 1.0; Flash Player 4
object : Object - An instance of a class. The object can be an instance of any of the built-in ActionScript classes or a custom class. This parameter is always to the left of the dot (.) operator.
property_or_method - The name of a property or method associated with an object. All the valid methods and properties for the built-in classes are listed in the method and property summary tables for that class. This parameter is always to the right of the dot (.) operator.
instancename : MovieClip - The instance name of a movie clip.variable -- The instance name to the left of the dot (.) operator can also represent a variable on the Timeline of the movie clip.
childinstance : MovieClip - A movie clip instance that is a child of, or nested in, another movie clip.
Object - The method, property or movie clip named on the right side of the dot.
The following example identifies the current value of the variable hairColor in the movie clip person_mc:
person_mc.hairColor
The Flash 4 authoring environment did not support dot syntax, but Flash MX 2004 files published for Flash Player 4 can use the dot operator. The preceding example is equivalent to the following (deprecated) Flash 4 syntax:
/person_mc:hairColor
The following example creates a new movie clip within the _root scope. Then a text field is created inside the movie clip called container_mc. The text field's autoSize property is set to true and then populated with the current date.
this.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
this.container_mc.createTextField("date_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
this.container_mc.date_txt.autoSize = true;
this.container_mc.date_txt.text = new Date();
The dot (.) operator is used when targeting instances within the SWF file and when you need to set properties and values for those instances.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00001272.html