03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

obj.func = function() {<br />

return true;<br />

};<br />

obj.callfunc();<br />

// output: true<br />

You get a syntax error when you use the incorrect version of Simple.as.<br />

Example<br />

In the following example, the keyword this references the Circle object:<br />

function Circle(radius:Number):Void {<br />

this.radius = radius;<br />

this.area = Math.PI*Math.pow(radius, 2);<br />

}<br />

var myCircle = new Circle(4);<br />

trace(myCircle.area);<br />

In the following statement assigned to a frame inside a movie clip, the keyword this<br />

references the current movie clip.<br />

// sets the alpha property of the current movie clip to 20<br />

this._alpha = 20;<br />

In the following statement inside a MovieClip.onPress h<strong>and</strong>ler, the keyword this references<br />

the current movie clip:<br />

this.square_mc.onPress = function() {<br />

startDrag(this);<br />

};<br />

this.square_mc.onRelease = function() {<br />

stopDrag();<br />

};<br />

See also<br />

Constants, onClipEvent h<strong>and</strong>ler<br />

Operators<br />

Symbolic operators are characters that specify how to combine, compare, or modify the values<br />

of an expression.<br />

Operators 105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!