Syntax - Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual

Programming actionscript 3.0
Table of Contents

Advertisement

Casting to String from an instance of the Date class returns a string representation of the date
that the instance contains. For example, the following example returns a string representation
of the Date class instance (the output shows result for Pacific Daylight Time):
var myDate:Date = new Date(2005,6,1);
trace(String(myDate)); // Fri Jul 1 00:00:00 GMT-0700 2005
The following table summarizes the results of casting to the String data type from other data
types.
Data type or value
Array
Boolean
Date
null
Number, int or uint
Object

Syntax

The syntax of a language defines a set of rules that must be followed when writing executable
code.
Case sensitivity
ActionScript 3.0 is a case-sensitive language. Identifiers that differ only in case are considered
different identifiers. For example, the following code creates two different variables:
var num1:int;
var Num1:int;
Dot syntax
The dot operator (
) provides a way to access the properties and methods of an object. Using
.
dot syntax, you can refer to a class property or method using an instance name, followed by
the dot operator and name of the property or method. For example, consider the following
class definition:
class DotExample
{
public var prop1:String;
Result of conversion to string
A string comprising all array elements.
or "
"true"
false"
A string representation of the Date object.
"null"
A string representation of the number.
If the instance is null,
; otherwise,
"null"
"[object Object]".

Syntax

71

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents