![MACROMEDIA Flash Lite 2 Скачать руководство пользователя страница 112](http://html1.mh-extra.com/html/macromedia/flash-lite-2/flash-lite-2_reference_687553112.webp)
112
ActionScript language elements
Example
In the following example, the keyword
this
references the Circle object:
function Circle(radius:Number):Void {
this.radius = radius;
this.area = Math.PI*Math.pow(radius, 2);
}
var myCircle = new Circle(4);
trace(myCircle.area);
In the following statement assigned to a frame inside a movie clip, 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 a MovieClip.onPress handler, the keyword
this
references
the current movie clip:
this.square_mc.onPress = function() {
startDrag(this);
};
this.square_mc.onRelease = function() {
stopDrag();
};
See also
on handler
,
onClipEvent handler
Operators
Symbolic operators are characters that specify how to combine, compare, or modify the values
of an expression.
Operators summary
Operator
Description
+ (
addition
)
Adds numeric expressions or concatenates (combines)
strings.
+= (
addition assignment
)
Assigns
expression1
the value of
expression1
+
expression2
.
[] (
array access
)
Initializes a new array or multidimensional array with the
specified elements (
a0
, and so on), or accesses
elements in an array.
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...