New Operator - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Returns
- The value of
Number
to a numeric value, it returns
Example
Usage 1: The following example assigns the value 50 to the variable
var x:Number = 5;
var y:Number = 10;
trace(x *= y); // output: 50
Usage 2: The second and third lines of the following example calculate the expressions on the
right side of the equal sign and assign the results to
var i:Number = 5;
var x:Number = 4 - 6;
var y:Number = i + 2;
trace(x *= y); // output: -14
See also
* multiplication operator

new operator

new constructor()
Creates a new, initially anonymous, object and calls the function identified by the
parameter. The
constructor
parentheses, as well as the newly created object, which is referenced using the keyword
The
function can then use
constructor
Availability: ActionScript 1.0; Flash Player 5
Operands
constructor : Object
The function is usually the name of the object type (for example,
to be constructed.
Example
The following example creates the
the objects
and
book1
function Book(name, price){
this.name = name;
this.price = price;
180
ActionScript language elements
expression1 * expression2
(not a number).
NaN
operator passes to the function any optional parameters in
new
this
- A function followed by any optional parameters in parentheses.
function and then uses the
Book()
.
book2
. If an expression cannot be converted
and
:
x
y
to set the variables of the object.
Array
:
x
this
,
, or
Number
Object
operator to create
new
.
)

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF