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.
: (type)
Availability
Flash Player 6.
Usage
[modifiers] var variableName:type
function functionName():type { ... }
function functionName(parameter1:type, ... , parameterN:type) [ :type ]{ ... }
Parameters
variableName
A native data type, class name that you have defined, or interface name.
type
functionName
An identifier for a function parameter.
parameter
Description
Operator; used for strict data typing; this operator specifies the variable type, function return
type, or function parameter type. When used in a variable declaration or assignment, this
operator specifies the variable's type; when used in a function declaration or definition, this
operator specifies the function's return type; when used with a function parameter in a function
definition, this operator specifies the variable type expected for that parameter.
Types are a compile-time-only feature. All types are checked at compile time, and errors are
generated when there is a mismatch. Mismatches can occur during assignment operations,
function calls, and class member dereferencing using the dot (
mismatch errors, use strict data typing (see
Types that you can use include all native object types, classes and interfaces that you define, and
Function and Void. The recognized native types are Boolean, Number, and String. All built-in
classes are also supported as native types. For more information, see
on page
18.
For more information, see
Example
Usage 1: The following example declares a public variable named
and assigns an empty string to it:
var userName:String = "";
98
Chapter 5: ActionScript Core Language Elements
An identifier for a variable.
An identifier for a function.
"Operator precedence and associativity" on page
) operator. To avoid type
.
"Strict data typing" on page
24).
"About data types"
32.
whose type is String
userName
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?