13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with geometry<br />

Class Methods or properties Description<br />

BitmapData applyFilter()<br />

copyChannel()<br />

merge()<br />

paletteMap()<br />

pixelDissolve()<br />

threshold()<br />

Matrix deltaTransformPoint()<br />

transformPoint()<br />

Rectangle bottomRight<br />

size<br />

topLeft<br />

Using Rectangle objects<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

A Rectangle object defines a rectangular area. A Rectangle object has a position, defined by the x and y coordinates of<br />

its upper-left corner, a width property, and a height property. You can define these properties for a new Rectangle<br />

object by calling the Rectangle() constructor function, as follows:<br />

import flash.geom.Rectangle;<br />

var rx:Number = 0;<br />

var ry:Number = 0;<br />

var rwidth:Number = 100;<br />

var rheight:Number = 50;<br />

var rect1:Rectangle = new Rectangle(rx, ry, rwidth, rheight);<br />

Resizing and repositioning Rectangle objects<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

There are a number of ways to resize and reposition Rectangle objects.<br />

You can directly reposition the Rectangle object by changing its x and y properties. This change has no effect on the<br />

width or height of the Rectangle object.<br />

import flash.geom.Rectangle;<br />

var x1:Number = 0;<br />

var y1:Number = 0;<br />

var width1:Number = 100;<br />

var height1:Number = 50;<br />

var rect1:Rectangle = new Rectangle(x1, y1, width1, height1);<br />

trace(rect1) // (x=0, y=0, w=100, h=50)<br />

rect1.x = 20;<br />

rect1.y = 30;<br />

trace(rect1); // (x=20, y=30, w=100, h=50)<br />

Last updated 6/6/2012<br />

Used to define the positions of rectangles that<br />

define the operations.<br />

Used to define points for which you want to<br />

apply a transformation.<br />

Used to define these properties.<br />

212

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

Saved successfully!

Ooh no, something went wrong!