EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 732

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
732 Chapter 12: ActionScript Dictionary
// statements in FLA file
import simple;
var obj:simple = new simple();
obj.num = 0;
obj.func = function():Boolean{
return true;
}
obj.callfunc(); // syntax error with incorrect version of simple.as
Example
In the following example, the keyword this references the Circle object.
function Circle(radius) {
this.radius = radius;
this.area = Math.PI * radius * radius;
}
In the following statement assigned to a frame, the keyword this references the current
movie clip.
// sets the alpha property of the current movie clip to 20
this._alpha = 20;
In the following statement inside an onClipEvent() handler, the keyword this references the
current movie clip.
// when the movie clip loads, a startDrag() operation
// is initiated for the current movie clip.
onClipEvent (load) {
startDrag (this, true);
}
See also
on()
, onClipEvent()
throw
Availability
Flash Player 7.
Usage
throw expression
Description
Statement; generates (“throws”) an error that can be handled (“caught”) by a catch{} or
finally{} code block. If an exception is not caught by a catch or finally block, the string
representation of the thrown value is sent to the Output panel.
Typically, you throw instances of the Error class or its subclasses (see the following examples).
Parameters
expression An ActionScript expression or object.

Table of Contents

Related product manuals