MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 118

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Note: Flash Lite 2.0 supports the addition (
concatenating strings. Flash Lite 1.x only supports the addition (
numeric expressions (such as
use the
operator to concatenate strings.
add
Availability: ActionScript 1.0; Flash Lite 1.0 - In Flash 4,
Flash Player 5 and later,
the data type of the parameter. Flash 4 files that are brought into the Flash 5 or later authoring
environment undergo a conversion process to maintain data type integrity. The following
example illustrates the conversion of a Flash 4 file that contains a numeric quality comparison:
Flash 4 file:
x + y
Converted Flash 5 or later file:
Operands
- A number or string.
expression1
- A number or string.
expression2
Returns
- A string, integer, or floating-point number.
Object
Example
Usage 1: The following example concatenates two strings and displays the result in the
Output panel.
var name:String = "Cola";
var instrument:String = "Drums";
trace(name + " plays " + instrument); // output: Cola plays Drums
Note: Flash Lite 1.x does not support the addition (
Flash Lite 1.x, you must use the
Usage 2: This statement adds the integers 2 and 3 and displays the resulting integer, 5, in the
Output panel:
trace(2 + 3); // output: 5
This statement adds the floating-point numbers 2.5 and 3.25 and displays the resulting
floating-point number, 5.75, in the Output panel
trace(2.5 + 3.25); // output: 5.75
118
ActionScript language elements
) operator for adding numeric expressions and
+
var1 = 1 + 2 // output: 3
is either a numeric operator or a string concatenator depending on
+
Number(x) + Number(y)
operator to concatenate strings.
add
) operator for adding
+
). For Flash Lite 1.x, you must
is a numeric operator only. In
+
) operator for concatenating strings. For
+

Advertisement

Table of Contents
loading

Table of Contents