blob: b0c272ce65a2291470c7b34b45cac38385ca20fe [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><apiPackage xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="flash.geom" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiPackage/apiPackage "><apiName class="- topic/title reference/title apiRef/apiName ">flash.geom</apiName><apiDetail class="- topic/body reference/refbody apiRef/apiDetail "/><apiClassifier languages="" id="flash.geom:Utils3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Utils3D</apiName><shortdesc class="- topic/shortdesc ">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
The Utils3D class contains static methods that simplify the implementation of certain three-dimensional
matrix operations.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">A utility class with static methods that simplify the implementation of certain three-dimensional operation.
</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The Utils3D class contains static methods that simplify the implementation of certain three-dimensional
matrix operations.
</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link><link href="flash.geom.xml#Vector3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Vector3D</linktext></link><link href="flash.geom.xml#Transform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Transform</linktext></link><link href="flash.geom.xml#PerspectiveProjection" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.PerspectiveProjection</linktext></link><link href="flash.display.xml#Graphics" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics</linktext></link><link href="flash.display.xml#GraphicsTrianglePath" class="- topic/link "><linktext class="- topic/linktext ">flash.display.GraphicsTrianglePath</linktext></link><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links><apiOperation id="flash.geom:Utils3D:pointTowards" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">pointTowards</apiName><shortdesc class="- topic/shortdesc ">
Interpolates the orientation of an object toward a position.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A modified version of the Matrix3D object specified in the second parameter. To
transform the display object using the <codeph class="+ topic/ph pr-d/codeph ">pointTowards()</codeph> method, set the Matrix3D property
of the display object to the returned Matrix3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">percent</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Number between 0 and 1 that incrementally turns the object toward the target.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">mat</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Matrix3D property of the object that is transformed.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pos</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The world-relative position of the target object. World-relative defines
the transformation of the object relative to the world space and coordinates,
where all objects are positioned.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">at</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The object-relative vector that defines where the display object is pointing.
Object-relative defines the transformation of the object relative to the object space,
the object's own frame of reference and coordinate system. Default value is (0,0,-1).
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">up</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The object-relative vector that defines "up" for the display object. If the object
is drawn looking down from the above, the <i class="+ topic/ph hi-d/i ">+z</i> axis is its "up" vector.
Object-relative defines the transformation of the object relative to the object space, the object's
own frame of reference and coordinate system. Default value is (0,-1,0).
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Interpolates the orientation of an object toward a position. The <codeph class="+ topic/ph pr-d/codeph ">pointTowards()</codeph>
method combines the functionality of the <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.pointAt()</codeph> and
<codeph class="+ topic/ph pr-d/codeph ">Matrix3D.interpolateTo()</codeph> methods.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">pointTowards()</codeph> method allows for in-place modification to the orientation.
It decomposes the Matrix3D of the display object and replaces the rotation elements
by ones that make a percent turn toward the position of the target. The object
can make an incremental turn toward the target while still moving in its own direction.
The consecutive calls to the <codeph class="+ topic/ph pr-d/codeph ">pointTowards()</codeph> followed by a translation method
can produce the animation of an object chasing or following a moving target.
First point the object a percent point toward the target, then incrementally move the
object along an axis.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/pointAt()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.pointAt()</linktext></link><link href="flash.geom.xml#Matrix3D/interpolateTo()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.interpolateTo()</linktext></link><link href="flash.geom.xml#Matrix3D/interpolate()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.interpolate()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Utils3D:projectVectors" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">projectVectors</apiName><shortdesc class="- topic/shortdesc ">
Using a projection Matrix3D object, projects a Vector of three-dimensional space coordinates (verts)
to a Vector of two-dimensional space coordinates (projectedVerts).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">m</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A projection Matrix3D object that implements the projection transformation. You can produce a
projection Matrix3D object using the <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.rawData</codeph> property.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">verts</apiItemName><apiType value="Vector$Number" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector of Numbers, where every three Numbers represent the <i class="+ topic/ph hi-d/i ">x</i>, <i class="+ topic/ph hi-d/i ">y</i>,
and <i class="+ topic/ph hi-d/i ">z</i> coordinates of a three-dimensional space, like <codeph class="+ topic/ph pr-d/codeph ">Vector3D(x,y,z)</codeph>.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">projectedVerts</apiItemName><apiType value="Vector$Number" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A vector of Numbers, where every two Numbers represent a projected two-dimensional
coordinate, like <codeph class="+ topic/ph pr-d/codeph ">Point(x,y)</codeph>. You should pre-allocate the Vector. The <codeph class="+ topic/ph pr-d/codeph ">projectVectors()</codeph>
method fills the values for each projected point.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">uvts</apiItemName><apiType value="Vector$Number" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A vector of Numbers, where every three Numbers represent the <i class="+ topic/ph hi-d/i ">u</i>, <i class="+ topic/ph hi-d/i ">v</i>, and <i class="+ topic/ph hi-d/i ">t</i>
elements of the <codeph class="+ topic/ph pr-d/codeph ">uvt</codeph> data. The <i class="+ topic/ph hi-d/i ">u</i> and <i class="+ topic/ph hi-d/i ">v</i> are the texture coordinate for each projected
point. The <i class="+ topic/ph hi-d/i ">t</i> value is the projection depth value, the distance from the eye to the Vector3D object in the
view or eye space. You should pre-allocate the Vector and specify the <i class="+ topic/ph hi-d/i ">u</i> and <i class="+ topic/ph hi-d/i ">v</i> values.
The <codeph class="+ topic/ph pr-d/codeph ">projectVectors</codeph> method fills the <i class="+ topic/ph hi-d/i ">t</i> value for each projected point.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Projects a Vector of three-dimensional space coordinates to a Vector of two-dimensional
space coordinates.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Using a projection Matrix3D object, projects a Vector of three-dimensional space coordinates (<i class="+ topic/ph hi-d/i ">verts</i>)
to a Vector of two-dimensional space coordinates (<codeph class="+ topic/ph pr-d/codeph ">projectedVerts</codeph>). The projected Vector
object should be pre-allocated before it is used as a parameter.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">projectVectors()</codeph> method also sets the <i class="+ topic/ph hi-d/i ">t</i> value of the <i class="+ topic/ph hi-d/i ">uvt</i> data.
You should pre-allocate a Vector that can hold the <i class="+ topic/ph hi-d/i ">uvts</i> data for each projected
Vector set of coordinates. Also specify the <i class="+ topic/ph hi-d/i ">u</i> and <i class="+ topic/ph hi-d/i ">v</i> values of the
<i class="+ topic/ph hi-d/i ">uvt</i> data. The <i class="+ topic/ph hi-d/i ">uvt</i> data is a Vector of normalized coordinates used for texture
mapping. In UV coordinates, (0,0) is the upper left of the bitmap, and (1,1) is the lower right of the bitmap.</p>
<p class="- topic/p ">This method can be used in conjunction with the <codeph class="+ topic/ph pr-d/codeph ">Graphics.drawTriangles()</codeph> method
and the <codeph class="+ topic/ph pr-d/codeph ">GraphicsTrianglePath</codeph> class.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.display.xml#Graphics/drawTriangles()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics.drawTriangles()</linktext></link><link href="flash.display.xml#GraphicsTrianglePath" class="- topic/link "><linktext class="- topic/linktext ">flash.display.GraphicsTrianglePath</linktext></link><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link><link href="flash.geom.xml#Utils3D/projectVector()" class="- topic/link "><linktext class="- topic/linktext ">projectVector()</linktext></link><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Utils3D:projectVector" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">projectVector</apiName><shortdesc class="- topic/shortdesc ">
Using a projection Matrix3D object, projects a Vector3D object from one space coordinate to another.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A new Vector3D with a transformed space coordinate.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">m</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A projection Matrix3D object that implements the projection transformation. If a display object
has a PerspectiveProjection object, you can use the <codeph class="+ topic/ph pr-d/codeph ">perspectiveProjection.toMatrix()</codeph> method
to produce a projection Matrix3D object that applies to the children of the display object. For more advance
projections, use the <codeph class="+ topic/ph pr-d/codeph ">matrix3D.rawData</codeph> property to create a custom projection matrix.
There is no built-in Matrix3D method for creating a projection Matrix3D object.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">v</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Vector3D object that is projected to a new space coordinate.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Using a projection Matrix3D object, projects a Vector3D object from one space coordinate to another.
The <codeph class="+ topic/ph pr-d/codeph ">projectVector()</codeph> method is like the <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.transformVector()</codeph>
method except that the <codeph class="+ topic/ph pr-d/codeph ">projectVector()</codeph> method divides the <i class="+ topic/ph hi-d/i ">x</i>, <i class="+ topic/ph hi-d/i ">y</i>, and <i class="+ topic/ph hi-d/i ">z</i>
elements of the original Vector3D object by the projection depth value. The depth value is the distance
from the eye to the Vector3D object in view or eye space. The default value for this distance is the
value of the <i class="+ topic/ph hi-d/i ">z</i> element.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/transformVector()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.transformVector()</linktext></link><link href="flash.geom.xml#Utils3D/projectVectors()" class="- topic/link "><linktext class="- topic/linktext ">projectVectors()</linktext></link></related-links></apiOperation></apiClassifier><apiClassifier languages="" id="flash.geom:Vector3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Vector3D</apiName><shortdesc class="- topic/shortdesc ">
The Vector3D class represents a point or a location in the three-dimensional space using the
Cartesian coordinates x, y, and z.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The Vector3D class represents a point or a location in the three-dimensional space using the
Cartesian coordinates x, y, and z. As in a two-dimensional space, the <codeph class="+ topic/ph pr-d/codeph ">x</codeph> property represents the
horizontal axis and the <codeph class="+ topic/ph pr-d/codeph ">y</codeph> property represents the vertical axis. In three-dimensional space, the
<codeph class="+ topic/ph pr-d/codeph ">z</codeph> property represents depth. The value of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph> property increases as the object moves to the right.
The value of the <codeph class="+ topic/ph pr-d/codeph ">y</codeph> property increases as the object moves down. The <codeph class="+ topic/ph pr-d/codeph ">z</codeph> property increases as the object
moves farther from the point of view. Using perspective projection and scaling, the object is seen
to be bigger when near and smaller when farther away from the screen. As in a right-handed three-dimensional
coordinate system, the positive z-axis points away from the viewer and the value of the <codeph class="+ topic/ph pr-d/codeph ">z</codeph> property
increases as the object moves away from the viewer's eye. The origin point (0,0,0) of the global space
is the upper-left corner of the stage.
<p class="- topic/p "><adobeimage alt="X, Y, Z Axes" href="../../images/xyzAxes.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">The Vector3D class can also represent a direction, an arrow pointing from the origin of the coordinates, such as
(0,0,0), to an endpoint; or a floating-point component of an RGB (Red, Green, Blue) color model.</p>
<p class="- topic/p ">Quaternion notation introduces a fourth element, the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property, which provides additional orientation
information. For example, the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property can define an angle of rotation of a Vector3D object. The
combination of the angle of rotation and the coordinates x, y, and z can determine the display object's
orientation. Here is a representation of Vector3D elements in matrix notation:</p>
<p class="- topic/p "><adobeimage alt="Vector3D elements" href="../../images/Vector3Delements.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObject" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject</linktext></link><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link><link href="flash.geom.xml#Utils3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Utils3D</linktext></link><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links><apiConstructor id="flash.geom:Vector3D:Vector3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Vector3D</apiName><shortdesc class="- topic/shortdesc ">
Creates an instance of a Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">x</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0.</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The first element, such as the x coordinate.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">y</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0.</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The second element, such as the y coordinate.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">z</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0.</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The third element, such as the z coordinate.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">w</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0.</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An optional element for additional data such as the angle of rotation.
</apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates an instance of a Vector3D object. If you do not specify a parameter for the constructor,
a Vector3D object is created with the elements (0,0,0,0).
</apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.geom:Vector3D:add" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">add</apiName><shortdesc class="- topic/shortdesc ">
Adds the value of the x, y, and z elements of the current Vector3D object
to the values of the x, y, and z elements of another Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object that is the result of adding the current Vector3D object
to another Vector3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object to be added to the current Vector3D object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Adds the current Vector3D object to another in order to create a new Vector3D object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Adds the value of the x, y, and z elements of the current Vector3D object
to the values of the x, y, and z elements of another Vector3D object.
The <codeph class="+ topic/ph pr-d/codeph ">add()</codeph> method does not change the current Vector3D object. Instead, it returns
a new Vector3D object with the new values.
<p class="- topic/p ">The result of adding two vectors together is a resultant vector. One way to visualize
the result is by drawing a vector from the origin or tail of the first vector
to the end or head of the second vector. The resultant vector is the distance
between the origin point of the first vector and the end point of the second vector.</p>
<p class="- topic/p "><adobeimage alt="Resultant Vector3D" href="../../images/resultantVector3D.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/incrementBy()" class="- topic/link "><linktext class="- topic/linktext ">incrementBy()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:angleBetween" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">angleBetween</apiName><shortdesc class="- topic/shortdesc ">
Returns the angle in radians between two vectors.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The angle between two Vector3D objects.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The first Vector3D object.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">b</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The second Vector3D object.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns the angle in radians between two vectors. The returned angle is the smallest radian
the first Vector3D object rotates until it aligns with the second Vector3D object.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">angleBetween()</codeph> method is a static method. You can use it directly as
a method of the Vector3D class.</p>
<p class="- topic/p ">To convert a degree to a radian, you can use the following formula:</p>
<p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">radian = Math.PI/180 ~~ degree</codeph></p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Vector3D:clone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">clone</apiName><shortdesc class="- topic/shortdesc ">
Returns a new Vector3D object that is an exact copy of the current Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A new Vector3D object that is a copy of the current Vector3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a new Vector3D object that is an exact copy of the current Vector3D object.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Vector3D:crossProduct" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">crossProduct</apiName><shortdesc class="- topic/shortdesc ">
Returns a new Vector3D object that is perpendicular (at a right angle) to the current
Vector3D and another Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A new Vector3D object that is perpendicular to the current Vector3D object and the Vector3D
object specified as the parameter.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A second Vector3D object.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a new Vector3D object that is perpendicular (at a right angle) to the current
Vector3D and another Vector3D object. If the returned Vector3D object's coordinates are
(0,0,0), then the two Vector3D objects are perpendicular to each other.
<p class="- topic/p "><adobeimage alt="Cross Product" href="../../images/crossproduct.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">You can use the normalized cross product of two vertices of a polygon surface with the
normalized vector of the camera or eye viewpoint to get a dot product. The value of
the dot product can identify whether a surface of a three-dimensional object is hidden
from the viewpoint.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/dotProduct()" class="- topic/link "><linktext class="- topic/linktext ">dotProduct()</linktext></link><link href="flash.geom.xml#Vector3D/normalize()" class="- topic/link "><linktext class="- topic/linktext ">normalize()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:decrementBy" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">decrementBy</apiName><shortdesc class="- topic/shortdesc ">
Decrements the value of the x, y, and z elements of the current Vector3D object
by the values of the x, y, and z elements of specified Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Vector3D object containing the values to subtract from the current Vector3D object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Decrements the current Vector3D object by another Vector3D object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Decrements the value of the x, y, and z elements of the current Vector3D object
by the values of the x, y, and z elements of specified Vector3D object. Unlike the
<codeph class="+ topic/ph pr-d/codeph ">Vector3D.subtract()</codeph> method, the <codeph class="+ topic/ph pr-d/codeph ">decrementBy()</codeph> method changes the current
Vector3D object and does not return a new Vector3D object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/subtract()" class="- topic/link "><linktext class="- topic/linktext ">subtract()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:distance" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">distance</apiName><shortdesc class="- topic/shortdesc ">
Returns the distance between two Vector3D objects.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The distance between two Vector3D objects.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pt1</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object as the first three-dimensional point.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pt2</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object as the second three-dimensional point.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns the distance between two Vector3D objects. The <codeph class="+ topic/ph pr-d/codeph ">distance()</codeph> method
is a static method. You can use it directly as a method of the Vector3D class to get
the Euclidean distance between two three-dimensional points.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Vector3D:dotProduct" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">dotProduct</apiName><shortdesc class="- topic/shortdesc ">
If the current Vector3D object and the one specified as the parameter are unit vertices, this
method returns the cosine of the angle between the two vertices.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A scalar which is the dot product of the current Vector3D object and the specified Vector3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The second Vector3D object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Returns the dot product of current and another Vector3D object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
If the current Vector3D object and the one specified as the parameter are unit vertices, this
method returns the cosine of the angle between the two vertices. Unit vertices are vertices that
point to the same direction but their length is one. They remove the length of the vector
as a factor in the result. You can use the <codeph class="+ topic/ph pr-d/codeph ">normalize()</codeph> method to convert a vector to a unit vector.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">dotProduct()</codeph> method finds the angle between two vertices. It is also
used in backface culling or lighting calculations. Backface culling is a procedure for determining
which surfaces are hidden from the viewpoint. You can use the normalized vertices from the camera,
or eye, viewpoint and the cross product of the vertices of a polygon surface to get the dot product.
If the dot product is less than zero, then the surface is facing the camera or the viewer. If the
two unit vertices are perpendicular to each other, they are orthogonal and the dot product is zero.
If the two vertices are parallel to each other, the dot product is one.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/crossProduct()" class="- topic/link "><linktext class="- topic/linktext ">crossProduct()</linktext></link><link href="flash.geom.xml#Vector3D/normalize()" class="- topic/link "><linktext class="- topic/linktext ">normalize()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:equals" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">equals</apiName><shortdesc class="- topic/shortdesc ">
Determines whether two Vector3D objects are equal by comparing the x, y, and z
elements of the current Vector3D object with a specified Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the specified Vector3D object is equal to the current
Vector3D object; <codeph class="+ topic/ph pr-d/codeph ">false</codeph> if it is not equal.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toCompare</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Vector3D object to be compared with the current Vector3D object.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">allFour</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An optional parameter that specifies whether the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property of
the Vector3D objects is used in the comparison.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether two Vector3D objects are equal by comparing the x, y, and z
elements of the current Vector3D object with a specified Vector3D object. If the values of
these elements are the same, the two Vector3D objects are equal. If the second
optional parameter is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, all four elements of the Vector3D objects,
including the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property, are compared.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/nearEquals()" class="- topic/link "><linktext class="- topic/linktext ">nearEquals()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:incrementBy" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">incrementBy</apiName><shortdesc class="- topic/shortdesc ">
Increments the value of the x, y, and z elements of the current Vector3D object
by the values of the x, y, and z elements of a specified Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Vector3D object to be added to the current Vector3D object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Increments the current Vector3D object by another Vector3D object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Increments the value of the x, y, and z elements of the current Vector3D object
by the values of the x, y, and z elements of a specified Vector3D object. Unlike the
<codeph class="+ topic/ph pr-d/codeph ">Vector3D.add()</codeph> method, the <codeph class="+ topic/ph pr-d/codeph ">incrementBy()</codeph> method changes the current
Vector3D object and does not return a new Vector3D object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/add()" class="- topic/link "><linktext class="- topic/linktext ">add()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:nearEquals" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">nearEquals</apiName><shortdesc class="- topic/shortdesc ">
Compares the elements of the current Vector3D object with the elements of a specified
Vector3D object to determine whether they are nearly equal.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the specified Vector3D object is nearly equal to the current
Vector3D object; <codeph class="+ topic/ph pr-d/codeph ">false</codeph> if it is not equal.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toCompare</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Vector3D object to be compared with the current Vector3D object.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">tolerance</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A number determining the tolerance factor. If the difference between the values
of the Vector3D element specified in the <codeph class="+ topic/ph pr-d/codeph ">toCompare</codeph> parameter and the current Vector3D element
is less than the tolerance number, the two values are considered nearly equal.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">allFour</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An optional parameter that specifies whether the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property of
the Vector3D objects is used in the comparison.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Compares the elements of the current Vector3D object with the elements of a specified
Vector3D object to determine whether they are nearly equal. The two Vector3D objects are nearly equal
if the value of all the elements of the two vertices are equal, or the result of the comparison
is within the tolerance range. The difference between two elements must be less than the number
specified as the <codeph class="+ topic/ph pr-d/codeph ">tolerance</codeph> parameter. If the third optional parameter is set to
<codeph class="+ topic/ph pr-d/codeph ">true</codeph>, all four elements of the Vector3D objects, including the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property,
are compared. Otherwise, only the x, y, and z elements are included in the comparison.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/equals()" class="- topic/link "><linktext class="- topic/linktext ">equals()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:negate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">negate</apiName><shortdesc class="- topic/shortdesc ">
Sets the current Vector3D object to its inverse.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Sets the current Vector3D object to its inverse. The inverse object is also considered the
opposite of the original object. The value of
the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">z</codeph> properties of the current Vector3D object
is changed to <codeph class="+ topic/ph pr-d/codeph ">-x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">-y</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">-z</codeph>.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Vector3D:normalize" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">normalize</apiName><shortdesc class="- topic/shortdesc ">
Converts a Vector3D object to a unit vector by dividing the first three elements
(x, y, z) by the length of the vector.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The length of the current Vector3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Converts a Vector3D object to a unit vector by dividing the first three elements
(x, y, z) by the length of the vector. Unit vertices are
vertices that have a direction but their length is one. They simplify
vector calculations by removing length as a factor.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Vector3D:project" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">project</apiName><shortdesc class="- topic/shortdesc ">
Divides the value of the x, y, and z properties of the
current Vector3D object by the value of its w property.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Divides the value of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">z</codeph> properties of the
current Vector3D object by the value of its <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property.
<p class="- topic/p ">If the current Vector3D object is the result of multiplying a Vector3D object by a projection Matrix3D object,
the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property can hold the transform value. The <codeph class="+ topic/ph pr-d/codeph ">project()</codeph> method then can
complete the projection by dividing the elements by the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property. Use the
<codeph class="+ topic/ph pr-d/codeph ">Matrix3D.rawData</codeph> property to create a projection Matrix3D object.</p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Vector3D:scaleBy" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">scaleBy</apiName><shortdesc class="- topic/shortdesc ">
Scales the current Vector3D object by a scalar, a magnitude.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">s</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier (scalar) used to scale a Vector3D object.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Scales the current Vector3D object by a scalar, a magnitude. The Vector3D object's
x, y, and z elements are multiplied by the scalar number
specified in the parameter. For example, if the vector is scaled by ten,
the result is a vector that is ten times longer. The scalar can also
change the direction of the vector. Multiplying the vector by a negative
number reverses its direction.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Vector3D:subtract" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">subtract</apiName><shortdesc class="- topic/shortdesc ">
Subtracts the value of the x, y, and z elements of the current Vector3D object
from the values of the x, y, and z elements of another Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A new Vector3D object that is the difference between the current Vector3D
and the specified Vector3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Vector3D object to be subtracted from the current Vector3D object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Subtracts the current Vector3D from another Vector3D object in order
to create a new Vector3D object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Subtracts the value of the x, y, and z elements of the current Vector3D object
from the values of the x, y, and z elements of another Vector3D object.
The <codeph class="+ topic/ph pr-d/codeph ">subtract()</codeph> method does not change the current Vector3D object. Instead,
this method returns a new Vector3D object with the new values.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/decrementBy()" class="- topic/link "><linktext class="- topic/linktext ">decrementBy()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Vector3D:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
Returns a string representation of the current Vector3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A string containing the values of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, and
<codeph class="+ topic/ph pr-d/codeph ">z</codeph> properties.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a string representation of the current Vector3D object. The string
contains the values of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">z</codeph> properties.
</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.geom:Vector3D:X_AXIS" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">X_AXIS</apiName><shortdesc class="- topic/shortdesc ">
The x axis defined as a Vector3D object with coordinates (1,0,0).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">unknown</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Vector3D</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The x axis defined as a Vector3D object with coordinates (1,0,0).
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Vector3D:Y_AXIS" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">Y_AXIS</apiName><shortdesc class="- topic/shortdesc ">
The y axis defined as a Vector3D object with coordinates (0,1,0).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">unknown</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Vector3D</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The y axis defined as a Vector3D object with coordinates (0,1,0).
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Vector3D:Z_AXIS" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">Z_AXIS</apiName><shortdesc class="- topic/shortdesc ">
The z axis defined as a Vector3D object with coordinates (0,0,1).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">unknown</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Vector3D</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The z axis defined as a Vector3D object with coordinates (0,0,1).
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Vector3D:w" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">w</apiName><shortdesc class="- topic/shortdesc ">
The fourth element of a Vector3D object (in addition to the x, y,
and z properties) can hold
data such as the angle of rotation.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The fourth element of a Vector3D object (in addition to the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>,
and <codeph class="+ topic/ph pr-d/codeph ">z</codeph> properties) can hold
data such as the angle of rotation. The default value is 0.
<p class="- topic/p ">Quaternion notation employs an angle as the fourth element in its calculation of
three-dimensional rotation. The <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property can be used to define the angle of rotation
about the Vector3D object. The combination of the rotation angle and the coordinates (x,y,z)
determines the display object's orientation. </p>
<p class="- topic/p ">In addition, the <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property can be used as a perspective
warp factor for a projected three-dimensional position or as a projection transform value in
representing a three-dimensional coordinate projected into the two-dimensional space. For example,
you can create a projection matrix using the <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.rawData</codeph> property, that, when
applied to a Vector3D object, produces a transform value in the Vector3D object's fourth element (the
<codeph class="+ topic/ph pr-d/codeph ">w</codeph> property). Dividing the Vector3D object's other elements by the transform value
then produces a projected Vector3D object. You can use the <codeph class="+ topic/ph pr-d/codeph ">Vector3D.project()</codeph> method
to divide the first three elements of a Vector3D object by its fourth element.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/project()" class="- topic/link "><linktext class="- topic/linktext ">project()</linktext></link></related-links></apiValue><apiValue id="flash.geom:Vector3D:x" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">x</apiName><shortdesc class="- topic/shortdesc ">
The first element of a Vector3D object, such as
the x coordinate of a point in the three-dimensional space.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The first element of a Vector3D object, such as
the x coordinate of a point in the three-dimensional space. The default value is 0.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Vector3D:y" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">y</apiName><shortdesc class="- topic/shortdesc ">
The second element of a Vector3D object, such as
the y coordinate of a point in the three-dimensional space.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The second element of a Vector3D object, such as
the y coordinate of a point in the three-dimensional space. The default value is 0.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Vector3D:z" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">z</apiName><shortdesc class="- topic/shortdesc ">
The third element of a Vector3D object, such as
the z coordinate of a point in three-dimensional space.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The third element of a Vector3D object, such as
the z coordinate of a point in three-dimensional space. The default value is 0.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Vector3D:lengthSquared:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">lengthSquared</apiName><shortdesc class="- topic/shortdesc ">
The square of the length of the current Vector3D object, calculated using the x,
y, and z properties.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The square of the length of the current Vector3D object.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The square of the length of the current Vector3D object, calculated using the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">y</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">z</codeph> properties. The <codeph class="+ topic/ph pr-d/codeph ">w</codeph> property is ignored.
Use the <codeph class="+ topic/ph pr-d/codeph ">lengthSquared()</codeph> method whenever possible instead of the slower
<codeph class="+ topic/ph pr-d/codeph ">Math.sqrt()</codeph> method call of the <codeph class="+ topic/ph pr-d/codeph ">Vector3D.length()</codeph> method.
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/length" class="- topic/link "><linktext class="- topic/linktext ">length</linktext></link></related-links></apiValue><apiValue id="flash.geom:Vector3D:length:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">length</apiName><shortdesc class="- topic/shortdesc ">
The length, magnitude, of the current Vector3D object from the origin (0,0,0) to
the object's x, y, and z coordinates.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The length of the current Vector3D object.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The length, magnitude, of the current Vector3D object from the origin (0,0,0) to
the object's x, y, and z coordinates. The <codeph class="+ topic/ph pr-d/codeph ">w</codeph>
property is ignored. A unit vector has a length or magnitude of one.
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Vector3D/lengthSquared" class="- topic/link "><linktext class="- topic/linktext ">lengthSquared</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:Matrix3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Matrix3D</apiName><shortdesc class="- topic/shortdesc ">
The Matrix3D class represents a transformation matrix that determines the position and orientation of
a three-dimensional (3D) display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Removed the following since it was very unclear. It could be used for a future example however:
<p class="- topic/p ">To support a camera viewpoint and motion, create a camera class that keeps a Matrix3D object for
handling the movement of the display objects relative to the camera. In the camera space, the display objects
move in the opposite direction of the camera movement. For example, when the camera moves closer, the objects
become bigger. In other words, if the camera moves down the world z axis, the objects moves up
the z axis. One way to produce this effect is by setting the Matrix3D object of the camera class
to the inverse of the display objects' transformation. If the display objects are children of the <code>root</code>
display object, the Matrix3D object of the camera class can be set to the inverse of the <code>root</code>
display object. Another option is to have the display objects as children of a camera object.</p>
</internal></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The Matrix3D class represents a transformation matrix that determines the position and orientation of
a three-dimensional (3D) display object. The matrix can perform transformation functions including
translation (repositioning along the x, y, and z axes), rotation, and scaling (resizing).
The Matrix3D class can also perform perspective projection, which maps points from the 3D coordinate space
to a two-dimensional (2D) view.
<p class="- topic/p ">A single matrix can combine multiple transformations and apply them at once to a 3D display object.
For example, a matrix can be applied to 3D coordinates to perform a rotation followed by a translation. </p>
<p class="- topic/p ">When you explicitly set the <codeph class="+ topic/ph pr-d/codeph ">z</codeph> property or any of the rotation or scaling
properties of a display object, a corresponding Matrix3D object is automatically created.</p>
<p class="- topic/p ">You can access a 3D display object's Matrix3D object through the <codeph class="+ topic/ph pr-d/codeph ">transform.matrix3d</codeph>
property. 2D objects do not have a Matrix3D object. </p>
<p class="- topic/p ">The value of the <codeph class="+ topic/ph pr-d/codeph ">z</codeph> property of a 2D object is zero and the value of its
<codeph class="+ topic/ph pr-d/codeph ">matrix3D</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
<p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> If the same Matrix3D object is assigned to two different display objects,
a runtime error is thrown.</p>
<p class="- topic/p ">The Matrix3D class uses a 4x4 square matrix: a table of four rows and columns of numbers that hold
the data for the transformation. The first three rows of the matrix hold data for each 3D
axis (x,y,z). The translation information is in the last column. The orientation
and scaling data are in the first three columns. The scaling factors are the diagonal numbers in
the first three columns. Here is a representation of Matrix3D elements:</p>
<p class="- topic/p "><adobeimage alt="Matrix3D elements" href="../../images/Matrix3Delements.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">You don't need to understand matrix mathematics to use the Matrix3D class.
It offers specific methods that simplify the task of transformation and projection, such as the
<codeph class="+ topic/ph pr-d/codeph ">appendTranslation()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">appendRotation()</codeph>, or <codeph class="+ topic/ph pr-d/codeph ">interpolateTo()</codeph> methods.
You also can use the <codeph class="+ topic/ph pr-d/codeph ">decompose()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> methods or the <codeph class="+ topic/ph pr-d/codeph ">rawData</codeph>
property to access the underlying matrix elements.</p>
<p class="- topic/p ">Display objects cache their axis rotation properties to have separate rotation for each axis
and to manage the different combinations of rotations. When a method of a Matrix3D object is called
to transform a display object, the rotation cache of the object is invalidated.</p>
</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObject" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject</linktext></link><link href="flash.geom.xml#Transform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Transform</linktext></link><link href="flash.geom.xml#PerspectiveProjection" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.PerspectiveProjection</linktext></link><link href="flash.geom.xml#Vector3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Vector3D</linktext></link><link href="flash.geom.xml#Orientation3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Orientation3D</linktext></link><link href="flash.geom.xml#Utils3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Utils3D</linktext></link><link href="flash.geom.xml#Matrix" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix</linktext></link></related-links><apiConstructor id="flash.geom:Matrix3D:Matrix3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Matrix3D</apiName><shortdesc class="- topic/shortdesc ">
Creates a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">v</apiItemName><apiType value="Vector$Number" name="type" class="- topic/state reference/state apiRef/apiType "/><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector of 16 Numbers, where each four elements can be a row or a column
of a 4x4 matrix.
</apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates a Matrix3D object. Matrix3D objects can be initialized with a Vector of 16 Numbers,
where every four elements can be a row or a column. Once the Matrix3D object is created,
you can access its matrix elements with the <codeph class="+ topic/ph pr-d/codeph ">rawData</codeph> property.
<p class="- topic/p ">If no parameter is defined, the constructor produces an identity or unit Matrix3D object.
In matrix notation, an identity matrix has a value of one for all elements on the main diagonal
position and a value of zero for all other elements. The value of the <codeph class="+ topic/ph pr-d/codeph ">rawData</codeph> property
of an identity matrix is: <codeph class="+ topic/ph pr-d/codeph ">1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1</codeph>. The position or translation
value of the identity matrix is <codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,0)</codeph>, the rotation setting is
<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,0)</codeph>, and the scale value is <codeph class="+ topic/ph pr-d/codeph ">Vector3D(1,1,1)</codeph>.</p>
</apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/identity()" class="- topic/link "><linktext class="- topic/linktext ">identity()</linktext></link><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links></apiConstructor><apiOperation id="flash.geom:Matrix3D:appendRotation" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">appendRotation</apiName><shortdesc class="- topic/shortdesc ">
Appends an incremental rotation to a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">degrees</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The degree of the rotation.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">axis</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The axis or direction of rotation. The usual axes are the <codeph class="+ topic/ph pr-d/codeph ">X_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(1,0,0)</codeph>),
<codeph class="+ topic/ph pr-d/codeph ">Y_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,1,0)</codeph>), and <codeph class="+ topic/ph pr-d/codeph ">Z_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,1)</codeph>).
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pivotPoint</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A point that determines the center of an object's rotation. The default pivot point
for an object is its registration point.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Appends an incremental rotation to a Matrix3D object. When the Matrix3D object is applied
to a display object, the matrix performs the rotation after other transformations in the Matrix3D
object.
<p class="- topic/p ">The display object's rotation is defined by an axis, an incremental degree
of rotation around the axis, and an optional pivot point for the center of the object's rotation.
The axis can be any general direction. The common axes are the <codeph class="+ topic/ph pr-d/codeph ">X_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(1,0,0)</codeph>),
<codeph class="+ topic/ph pr-d/codeph ">Y_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,1,0)</codeph>), and <codeph class="+ topic/ph pr-d/codeph ">Z_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,1)</codeph>).
In aviation terminology, the rotation about the y axis is called yaw. The rotation about the x axis is
called pitch. The rotation about the z axis is called roll.</p>
<p class="- topic/p ">The order of transformation matters. A rotation followed by a translation transformation
produces a different effect than a translation followed by a rotation transformation.</p>
<p class="- topic/p ">The rotation effect is not absolute. It is relative to the current position and orientation.
To make an absolute change to the transformation matrix, use the <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method.
The <codeph class="+ topic/ph pr-d/codeph ">appendRotation()</codeph> method is also different from the axis rotation property of
the display object, such as <codeph class="+ topic/ph pr-d/codeph ">rotationX</codeph> property. The rotation property is always
performed before any translation, whereas the <codeph class="+ topic/ph pr-d/codeph ">appendRotation()</codeph> method is performed
relative to what is already in the matrix. To make sure that you get a similar effect as the display
object's axis rotation property, use the <codeph class="+ topic/ph pr-d/codeph ">prependRotation()</codeph> method, which performs
the rotation before other transformations in the matrix.</p>
<p class="- topic/p ">When the <codeph class="+ topic/ph pr-d/codeph ">appendRotation()</codeph> method's transformation is applied to a Matrix3D object
of a display object, the cached rotation property values of the display object are invalidated.</p>
<p class="- topic/p ">One way to have a display object rotate around a specific point relative to its location is
to set the translation of the object to the specified point, rotate the object using the <codeph class="+ topic/ph pr-d/codeph ">appendRotation()</codeph>
method, and translate the object back to the original position. In the following example, the
<codeph class="+ topic/ph pr-d/codeph ">myObject</codeph> 3D display object makes a y-axis rotation around
the coordinate (10,10,0).</p>
<codeblock rev="3.0" xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
myObject.z = 1;
myObject.transform.matrix3D.appendTranslation(10,10,0);
myObject.transform.matrix3D.appendRotation(1, Vector3D.Y_AXIS);
myObject.transform.matrix3D.appendTranslation(-10,-10,0);
</codeblock>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/prependRotation()" class="- topic/link "><linktext class="- topic/linktext ">prependRotation()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:appendScale" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">appendScale</apiName><shortdesc class="- topic/shortdesc ">
Appends an incremental scale change along the x, y, and z axes
to a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">xScale</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the x axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">yScale</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the y axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">zScale</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the z axis.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Appends an incremental scale change along the x, y, and z axes
to a Matrix3D object. When the Matrix3D object is applied to a display object, the matrix performs
the scale changes after other transformations in the Matrix3D object. The default scale
factor is (1.0, 1.0, 1.0).
<p class="- topic/p ">The scale is defined as a set of three incremental changes along the three axes (x,y,z).
You can multiply each axis with a different number. When the scale changes are applied to
a display object, the object's size increases or decreases. For example, setting
the x, y, and z axes to two doubles the size of the object, while
setting the axes to <codeph class="+ topic/ph pr-d/codeph ">0.5</codeph> halves the size. To make sure that
the scale transformation only affects a specific axis, set the other parameters to one.
A parameter of one means no scale change along the specific axis.</p>
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">appendScale()</codeph> method can be used for resizing as well as
for managing distortions, such as stretch or contract of a display object, or for zooming in
and out on a location. Scale transformations are automatically performed during a display
object's rotation and translation.</p>
<p class="- topic/p ">The order of transformation matters. A resizing followed by a translation transformation
produces a different effect than a translation followed by a resizing transformation.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/prependScale()" class="- topic/link "><linktext class="- topic/linktext ">prependScale()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:appendTranslation" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">appendTranslation</apiName><shortdesc class="- topic/shortdesc ">
Appends an incremental translation, a repositioning along the x, y, and z axes,
to a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">x</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An incremental translation along the x axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">y</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An incremental translation along the y axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">z</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An incremental translation along the z axis.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Appends an incremental translation, a repositioning along the x, y, and z axes,
to a Matrix3D object. When the Matrix3D object is applied to a display object, the matrix performs
the translation changes after other transformations in the Matrix3D object.
<p class="- topic/p ">The translation is defined as a set of three incremental changes along the three axes (x,y,z).
When the transformation is applied to a display object, the display object moves from it current
location along the x, y, and z axes as specified by the parameters.
To make sure that the translation only affects a specific axis, set the other parameters to zero.
A zero parameter means no change along the specific axis.</p>
<p class="- topic/p ">The translation changes are not absolute. They are relative to the current
position and orientation of the matrix. To make an absolute change to the transformation matrix,
use the <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method. The order of transformation also matters. A translation
followed by a rotation transformation produces a different effect than a rotation followed
by a translation.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/prependTranslation()" class="- topic/link "><linktext class="- topic/linktext ">prependTranslation()</linktext></link><link href="flash.geom.xml#Matrix3D/position" class="- topic/link "><linktext class="- topic/linktext ">position</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:append" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">append</apiName><shortdesc class="- topic/shortdesc ">
Appends the matrix by multiplying another Matrix3D object by the current Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">lhs</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A left-hand-side matrix that is multiplied by the current Matrix3D object.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Appends the matrix by multiplying another Matrix3D object by the current Matrix3D object.
The result combines both matrix transformations. You can multiply a Matrix3D object
by many matrixes. The final Matrix3D object contains the result of all the
transformations.
<p class="- topic/p ">Matrix multiplication is different from matrix addition. Matrix multiplication is not commutative.
In other words, A times B is not equal to B times A. With the <codeph class="+ topic/ph pr-d/codeph ">append()</codeph> method,
the multiplication happens from the left side, meaning the <codeph class="+ topic/ph pr-d/codeph ">lhs</codeph> Matrix3D object is
on the left side of the multiplication operator.</p>
<codeph class="+ topic/ph pr-d/codeph ">thisMatrix = lhs ~~ thisMatrix;</codeph>
<p class="- topic/p ">The first time the <codeph class="+ topic/ph pr-d/codeph ">append()</codeph> method is called, it makes a modification relative
to the parent space. Subsequent calls are relative to the frame of reference of the appended
Matrix3D object.</p>
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">append()</codeph> method replaces the current matrix with the appended matrix.
If you want to append two matrixes without altering the current matrix, copy the
current matrix by using the <codeph class="+ topic/ph pr-d/codeph ">clone()</codeph> method and then apply the <codeph class="+ topic/ph pr-d/codeph ">append()</codeph>
method to the copy.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/prepend()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.prepend()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:clone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">clone</apiName><shortdesc class="- topic/shortdesc ">
Returns a new Matrix3D object that is an exact copy of the current Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A new Matrix3D object that is an exact copy of the current Matrix3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a new Matrix3D object that is an exact copy of the current Matrix3D object.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix3D:decompose" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">decompose</apiName><shortdesc class="- topic/shortdesc ">
Returns the transformation matrix's translation, rotation, and scale settings as
a Vector of three Vector3D objects.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector of three Vector3D objects, each holding the translation, rotation, and scale
settings, respectively.
</apiDesc><apiType value="Vector$flash.geom:Vector3D" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">orientationStyle</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">eulerAngles</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An optional parameter that determines the orientation style
used for the matrix transformation. The three types of orientation style are
<codeph class="+ topic/ph pr-d/codeph ">eulerAngles</codeph> (constant <codeph class="+ topic/ph pr-d/codeph ">EULER_ANGLES</codeph>), <codeph class="+ topic/ph pr-d/codeph ">axisAngle</codeph>
(constant <codeph class="+ topic/ph pr-d/codeph ">AXIS_ANGLE</codeph>), and <codeph class="+ topic/ph pr-d/codeph ">quaternion</codeph> (constant <codeph class="+ topic/ph pr-d/codeph ">QUATERNION</codeph>).
For additional information on the different orientation style, see the <codeph class="+ topic/ph pr-d/codeph ">geom.Orientation3D</codeph> class.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns the transformation matrix's translation, rotation, and scale settings as
a Vector of three Vector3D objects. The first Vector3D object holds the translation
elements. The second Vector3D object holds the rotation elements. The third Vector3D object
holds the scale elements.
<p class="- topic/p ">Some Matrix3D methods, such as the <codeph class="+ topic/ph pr-d/codeph ">interpolateTo()</codeph> method, automatically
decompose and recompose the matrix to perform their transformation.</p>
<p class="- topic/p ">To modify the matrix's transformation with an absolute parent frame of reference,
retrieve the settings with the <codeph class="+ topic/ph pr-d/codeph ">decompose()</codeph> method and make the appropriate changes.
You can then set the Matrix3D object to the modified transformation using the <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph>
method.</p>
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">decompose()</codeph> method's parameter specifies the orientation style that
is meant to be used for the transformation. The default orientation is <codeph class="+ topic/ph pr-d/codeph ">eulerAngles</codeph>,
which defines the orientation with three separate angles of rotation for each axis.
The rotations occur consecutively and do not change the axis of each other. The
display object's axis rotation properties perform Euler Angles orientation style transformation.
The other orientation style options are <codeph class="+ topic/ph pr-d/codeph ">axisAngle</codeph> and <codeph class="+ topic/ph pr-d/codeph ">quaternion</codeph>.
The Axis Angle orientation uses a combination of an axis and an angle to determine the orientation.
The axis around which the object is rotated is a unit vector that represents a direction.
The angle represents the magnitude of the rotation about the vector. The direction also
determines where a display object is facing and the angle determines which way is up.
The <codeph class="+ topic/ph pr-d/codeph ">appendRotation()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">prependRotation()</codeph> methods use the Axis Angle orientation.
The quaternion orientation uses complex numbers and the fourth element of a vector.
The three axes of rotation (x,y,z) and an angle of rotation (w) represent the orientation.
The <codeph class="+ topic/ph pr-d/codeph ">interpolate()</codeph> method uses quaternion.</p>
</apiDesc><example conref="examples\Matrix3DdecomposeExample.as" class="- topic/example "> This example uses the <codeph class="+ topic/ph pr-d/codeph ">decompose()</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> methods to have an ellipse stretch horizontally
while moving toward the vanishing point. The first Vector3D object returned
by the <codeph class="+ topic/ph pr-d/codeph ">decompose()</codeph> method holds the translation coordinates. The
third Vector3D object holds the scale settings. The Vector3D object's
<codeph class="+ topic/ph pr-d/codeph ">incrementBy()</codeph> method increments the matrix's absolute translation
and scale settings.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.MovieClip;
import flash.display.Shape;
import flash.geom.*;
import flash.events.Event;
public class Matrix3DdecomposeExample extends MovieClip {
private var ellipse:Shape = new Shape();
public function Matrix3DdecomposeExample():void {
ellipse.x = (this.stage.stageWidth / 2);
ellipse.y = (this.stage.stageHeight - 40);
ellipse.z = 1;
ellipse.graphics.beginFill(0xFF0000);
ellipse.graphics.lineStyle(2);
ellipse.graphics.drawEllipse(0, 0, 50, 40);
ellipse.graphics.endFill();
addChild(ellipse);
ellipse.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function enterFrameHandler(e:Event):void {
var v3:Vector.&lt;Vector3D&gt; = new Vector.&lt;Vector3D&gt;(3);
v3 = ellipse.transform.matrix3D.decompose();
v3[0].incrementBy(new Vector3D(0,0,1));
v3[2].incrementBy(new Vector3D(0.01,0,0));
ellipse.transform.matrix3D.recompose(v3);
}
}
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Orientation3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Orientation3D</linktext></link><link href="flash.geom.xml#Matrix3D/recompose()" class="- topic/link "><linktext class="- topic/linktext ">recompose()</linktext></link><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:deltaTransformVector" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">deltaTransformVector</apiName><shortdesc class="- topic/shortdesc ">
Uses the transformation matrix without its translation elements
to transform a Vector3D object from one space coordinate to another.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object with the transformed coordinates.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">v</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object holding the coordinates that are going to be transformed.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Uses the transformation matrix without its translation elements
to transform a Vector3D object from one space coordinate to another.
The returned Vector3D object holds the new coordinates after the rotation
and scaling transformations have been applied. If the <codeph class="+ topic/ph pr-d/codeph ">deltaTransformVector()</codeph>
method applies a matrix that only contains a translation transformation,
the returned Vector3D is the same as the original Vector3D object.
<p class="- topic/p ">You can use the <codeph class="+ topic/ph pr-d/codeph ">deltaTransformVector()</codeph> method to have a
display object in one coordinate space respond to the rotation transformation
of a second display object. The object does not copy the rotation;
it only changes its position to reflect the changes in the rotation.
For example, to use the <codeph class="+ topic/ph pr-d/codeph ">display.Graphics</codeph> API for drawing a rotating
3D display object, you must map the object's rotating coordinates
to a 2D point. First, retrieve the object's 3D
coordinates after each rotation, using the <codeph class="+ topic/ph pr-d/codeph ">deltaTransformVector()</codeph> method.
Next, apply the display object's <codeph class="+ topic/ph pr-d/codeph ">local3DToGlobal()</codeph> method to translate the
3D coordinates to 2D points. You can then use
the 2D points to draw the rotating 3D object.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/transformVectors()" class="- topic/link "><linktext class="- topic/linktext ">transformVectors()</linktext></link><link href="flash.geom.xml#Matrix3D/transformVector()" class="- topic/link "><linktext class="- topic/linktext ">transformVector()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:identity" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">identity</apiName><shortdesc class="- topic/shortdesc ">
Converts the current matrix to an identity or unit matrix.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Converts the current matrix to an identity or unit matrix. An identity matrix has a value
of one for the elements on the main diagonal and a value of zero for all
other elements. The result is a matrix where the <codeph class="+ topic/ph pr-d/codeph ">rawData</codeph> value is
<codeph class="+ topic/ph pr-d/codeph ">1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1</codeph> and the rotation setting is set to
<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,0)</codeph>, the position or translation setting is set to
<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,0)</codeph>, and the scale is set to <codeph class="+ topic/ph pr-d/codeph ">Vector3D(1,1,1)</codeph>.
Here is a representation of an identity matrix.
<p class="- topic/p "><adobeimage alt="Identity Matrix" href="../../images/identityMatrix.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">An object transformed by applying an identity matrix performs no transformation.
In other words, if a matrix is multiplied by an identity matrix, the result is
a matrix that is the same as (identical to) the original matrix.</p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix3D:interpolateTo" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">interpolateTo</apiName><shortdesc class="- topic/shortdesc ">
Interpolates the display object's matrix a percent closer to a target's matrix.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toMat</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The target Matrix3D object.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">percent</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value between <codeph class="+ topic/ph pr-d/codeph ">0</codeph> and <codeph class="+ topic/ph pr-d/codeph ">1</codeph> that determines the location of the display object
relative to the target. The closer the value is to <codeph class="+ topic/ph pr-d/codeph ">1.0</codeph>, the closer the display object
is to its current position. The closer the value is to <codeph class="+ topic/ph pr-d/codeph ">0</codeph>, the closer the display object is
to the target.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Interpolates the display object's matrix a percent closer to a target's matrix. All the elements for
translation, rotation, and scale of the display object are interpolated to values
between the current and target display object's matrix.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">interpolateTo()</codeph> method avoids the unwanted results that can occur when
using methods such as the display object's axis rotation properties. The <codeph class="+ topic/ph pr-d/codeph ">interpolateTo()</codeph>
method invalidates the cached value of the rotation property of the display
object and converts the orientation elements of the display object's matrix to a quaternion
before interpolation. This method guarantees the shortest, most efficient path for the rotation.
It also produces a smooth, gimbal-lock-free rotation. A gimbal lock can occur when using Euler Angles,
where each axis is handled independently. During the rotation around two or more axes, the axes can
become aligned, leading to unexpected results. Quaternion rotation avoids the gimbal lock.</p>
<p class="- topic/p ">Consecutive calls to the <codeph class="+ topic/ph pr-d/codeph ">interpolateTo()</codeph> method can produce the effect of a display
object starting quickly and then slowly approaching another display object. For example, if the percent
parameter is set to <codeph class="+ topic/ph pr-d/codeph ">0.1</codeph>, the display object moves ten percent toward the target object
specified by the <codeph class="+ topic/ph pr-d/codeph ">toMat</codeph> parameter. On subsequent calls or in subsequent
frames, the object moves ten percent of the remaining 90 percent, then ten percent of the
remaining 80 percent, until it reaches the target.</p>
</apiDesc><example conref="examples\InterpolateToExample.as" class="- topic/example "> In this example, <codeph class="+ topic/ph pr-d/codeph ">ellipse2</codeph>, a three-dimensional display object, goes
toward <codeph class="+ topic/ph pr-d/codeph ">ellipse1</codeph>, another three-dimensional display object.
<codeph class="+ topic/ph pr-d/codeph ">ellipse2</codeph> follows <codeph class="+ topic/ph pr-d/codeph ">ellipse1</codeph> around trying to catch it.
If <codeph class="+ topic/ph pr-d/codeph ">ellipse1</codeph> does not rotate around its y axis, <codeph class="+ topic/ph pr-d/codeph ">ellipse2</codeph>
will reach and land on top of <codeph class="+ topic/ph pr-d/codeph ">ellipse1</codeph>. The two ellipses are
drawn in the same way but are placed in different three-dimensional world-space locations.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.MovieClip;
import flash.display.Shape;
import flash.display.Graphics;
import flash.geom.*;
import flash.events.Event;
public class InterpolateToExample extends MovieClip {
private var ellipse1:Shape = new Shape();
private var ellipse2:Shape = new Shape();
public function InterpolateToExample():void {
ellipse1 = myEllipses(250, 100, 500, 0xFF0000);
addChild(ellipse1);
ellipse2 = myEllipses(-30, 120, 1, 0x00FF00);
addChild(ellipse2);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function myEllipses(x:Number, y:Number, z:Number, c:Number):Shape {
var s:Shape = new Shape();
s.x = x;
s.y = y;
s.z = z;
s.graphics.beginFill(c);
s.graphics.lineStyle(2);
s.graphics.drawEllipse(100, 50, 100, 80);
s.graphics.endFill();
return s;
}
private function enterFrameHandler(e:Event) {
ellipse1.rotationY += 1;
ellipse2.transform.matrix3D.interpolateTo(ellipse1.transform.matrix3D, 0.1);
}
}
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/interpolate()" class="- topic/link "><linktext class="- topic/linktext ">interpolate()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:interpolate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">interpolate</apiName><shortdesc class="- topic/shortdesc ">
Simplifies the interpolation from one frame of reference to another by interpolating a display object
a percent point closer to a target display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Matrix3D object with elements that place the values of the matrix between the original matrix
and the target matrix. When the returned matrix is applied to the <codeph class="+ topic/ph pr-d/codeph ">this</codeph> display object, the
object moves the specified percent closer to the target object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">thisMat</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Matrix3D object that is to be interpolated.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toMat</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The target Matrix3D object.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">percent</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value between <codeph class="+ topic/ph pr-d/codeph ">0</codeph> and <codeph class="+ topic/ph pr-d/codeph ">1</codeph> that determines the percent
the <codeph class="+ topic/ph pr-d/codeph ">thisMat</codeph> Matrix3D object is interpolated toward the target Matrix3D object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Interpolates a display object a percent point closer to a target display object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Simplifies the interpolation from one frame of reference to another by interpolating a display object
a percent point closer to a target display object. The result is a new Matrix3D object
where all the elements for the translation, rotation, and scale are interpolated to values
between the current display object and the target display object.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">interpolate()</codeph> method avoids some of the unwanted results that can occur when
using methods such as the display object's axis rotation properties. The <codeph class="+ topic/ph pr-d/codeph ">interpolate()</codeph>
method invalidates the cached value of the rotation property of the display
object and converts the orientation elements of the display object's matrix to a quaternion
before interpolation. This method guarantees the shortest, most efficient path for the rotation.
It also produces a smooth, gimbal-lock-free rotation. A gimbal lock can occur when using Euler Angles,
where each axis is handled independently. During the rotation around two or more axes, the axes can
become aligned, leading to unexpected results. Quaternion rotation avoids the gimbal lock.</p>
<p class="- topic/p ">Consecutive calls to the <codeph class="+ topic/ph pr-d/codeph ">interpolate()</codeph> method can produce the effect of a display
object starting quickly and then slowly approaching another display object. For example, if you set
the <codeph class="+ topic/ph pr-d/codeph ">thisMat</codeph> parameter to the returned Matrix3D object, the <codeph class="+ topic/ph pr-d/codeph ">toMat</codeph> parameter
to the target display object's
associated Matrix3D object, and the <codeph class="+ topic/ph pr-d/codeph ">percent</codeph> parameter to <codeph class="+ topic/ph pr-d/codeph ">0.1</codeph>,
the display object moves ten percent toward the target object. On subsequent calls or in subsequent
frames, the object moves ten percent of the remaining 90 percent, then ten percent of the remaining
80 percent, until it reaches the target.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/interpolateTo()" class="- topic/link "><linktext class="- topic/linktext ">interpolateTo()</linktext></link><link href="flash.geom.xml#Utils3D/pointTowards()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Utils3D.pointTowards()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:invert" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">invert</apiName><shortdesc class="- topic/shortdesc ">
Inverts the current matrix.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Returns <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the matrix was successfully inverted.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Inverts the current matrix. An inverted matrix is the same size as the original
but performs the opposite transformation of the original matrix. For example,
if the original matrix has an object rotate around the x axis in one direction,
the inverse of the matrix will have the object rotate around the axis in
the opposite direction. Applying an inverted matrix to an object undoes the
transformation performed by the original matrix. If a matrix is multiplied by its
inverse matrix, the result is an identity matrix.
<p class="- topic/p ">An inverse of a matrix can be used to divide one matrix by another. The way to divide
matrix A by matrix B is to multiply matrix A by the inverse of matrix B. The inverse matrix can also be used
with a camera space. When the camera moves in the world space, the object in the world needs to
move in the opposite direction to transform from the world view to the camera or
view space. For example, if the camera moves closer, the objects becomes bigger.
In other words, if the camera moves down the world z axis, the object moves up
world z axis.</p>
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">invert()</codeph> method replaces the current matrix with an inverted matrix.
If you want to invert a matrix without altering the current matrix, first copy the
current matrix by using the <codeph class="+ topic/ph pr-d/codeph ">clone()</codeph> method and then apply the <codeph class="+ topic/ph pr-d/codeph ">invert()</codeph>
method to the copy.</p>
<p class="- topic/p ">The Matrix3D object must be invertible.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/determinant" class="- topic/link "><linktext class="- topic/linktext ">determinant</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:pointAt" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">pointAt</apiName><shortdesc class="- topic/shortdesc ">
Rotates the display object so that it faces a specified position.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pos</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The world-relative position of the target object. World-relative defines
the object's transformation relative to the world space and coordinates, where all objects are positioned.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">at</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The object-relative vector that defines where the display object is pointing.
Object-relative defines the object's transformation relative to the object space, the object's own
frame of reference and coordinate system. Default value is the <i class="+ topic/ph hi-d/i ">+y</i> axis (0,1,0).
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">up</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The object-relative vector that defines "up" for the display object. If the object
is drawn looking down from above, the <i class="+ topic/ph hi-d/i ">+z</i> axis is its "up" vector.
Object-relative defines the object's transformation relative to the object space, the object's own
frame of reference and coordinate system. Default value is the <i class="+ topic/ph hi-d/i ">+z</i>-axis (0,0,1).
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Rotates the display object so that it faces a specified position. This method allows for an
in-place modification to the orientation. The forward direction vector of the display object
(the <codeph class="+ topic/ph pr-d/codeph ">at</codeph> Vector3D object) points at the specified world-relative position.
The display object's up direction is specified with the <codeph class="+ topic/ph pr-d/codeph ">up</codeph>
Vector3D object.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">pointAt()</codeph> method invalidates the cached rotation property
value of the display object. The method decomposes the display object's matrix and modifies
the rotation elements to have the object turn to the specified position. It
then recomposes (updates) the display object's matrix, which performs the transformation.
If the object is pointing at a moving target, such as a moving object's position,
then with each subsequent call, the method has the object rotate toward the moving target.</p>
<p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> If you use the <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.pointAt()</codeph> method without setting the optional parameters,
a target object does not face the specified world-relative position by default. You need to set the values
for <codeph class="+ topic/ph pr-d/codeph ">at</codeph> to the -y-axis (0,-1,0) and <codeph class="+ topic/ph pr-d/codeph ">up</codeph> to the -z axis (0,0,-1).</p>
</apiDesc><example conref="examples\PointAtExample.as" class="- topic/example "> In this example, a triangle points and follows the path of the ellipse's
movement. The ellipse and triangle are set to different locations.
The ellipse then moves up toward the corner of the stage. The triangle
follows the ellipse's translation changes. You can change the triangle's
shape and the "at" and "up" parameters of the <codeph class="+ topic/ph pr-d/codeph ">pointAt()</codeph>
to see their impacts on the triangle's movement.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.MovieClip;
import flash.display.Shape;
import flash.display.Graphics;
import flash.geom.*;
import flash.events.Event;
public class PointAtExample extends MovieClip {
private var ellipse:Shape = new Shape();
private var triangle:Shape = new Shape();
public function PointAtExample():void {
ellipse.graphics.beginFill(0xFF0000);
ellipse.graphics.lineStyle(2);
ellipse.graphics.drawEllipse(30, 40, 50, 40);
ellipse.graphics.endFill();
ellipse.x = 100;
ellipse.y = 150;
ellipse.z = 1;
triangle.graphics.beginFill(0x0000FF);
triangle.graphics.moveTo(0, 0);
triangle.graphics.lineTo(40, 40);
triangle.graphics.lineTo(80, 0);
triangle.graphics.lineTo(0, 0);
triangle.graphics.endFill();
triangle.x = 200;
triangle.y = 50;
triangle.z = 1;
addChild(ellipse);
addChild(triangle);
ellipse.addEventListener(Event.ENTER_FRAME, ellipseEnterFrameHandler);
triangle.addEventListener(Event.ENTER_FRAME, triangleEnterFrameHandler);
}
private function ellipseEnterFrameHandler(e:Event) {
if(e.target.y &gt; 0) {
e.target.y -= 1;
e.target.x -= 1;
}
}
private function triangleEnterFrameHandler(e:Event) {
e.target.transform.matrix3D.pointAt(ellipse.transform.matrix3D.position,
Vector3D.X_AXIS, Vector3D.Y_AXIS);
}
}
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Utils3D/pointTowards()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Utils3D.pointTowards()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:prependRotation" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">prependRotation</apiName><shortdesc class="- topic/shortdesc ">
Prepends an incremental rotation to a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">degrees</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The degree of rotation.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">axis</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The axis or direction of rotation. The usual axes are the <codeph class="+ topic/ph pr-d/codeph ">X_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(1,0,0)</codeph>),
<codeph class="+ topic/ph pr-d/codeph ">Y_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,1,0)</codeph>), and <codeph class="+ topic/ph pr-d/codeph ">Z_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,1)</codeph>).
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pivotPoint</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A point that determines the center of rotation. The default pivot point
for an object is its registration point.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Prepends an incremental rotation to a Matrix3D object. When the Matrix3D object is applied
to a display object, the matrix performs the rotation before other transformations in the Matrix3D
object.
<p class="- topic/p ">The display object's rotation is defined by an axis, an incremental degree
of rotation around the axis, and an optional pivot point for the center of the object's rotation.
The axis can be any general direction. The common axes are the <codeph class="+ topic/ph pr-d/codeph ">X_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(1,0,0)</codeph>),
<codeph class="+ topic/ph pr-d/codeph ">Y_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,1,0)</codeph>), and <codeph class="+ topic/ph pr-d/codeph ">Z_AXIS</codeph> (<codeph class="+ topic/ph pr-d/codeph ">Vector3D(0,0,1)</codeph>).
In aviation terminology, the rotation about the y axis is called yaw.
The rotation about the x axis is called pitch.
The rotation about the z axis is called roll.</p>
<p class="- topic/p ">The order of transformation matters. A rotation followed by a translation transformation
produces a different effect than a translation followed by a rotation.</p>
<p class="- topic/p ">The rotation effect is not absolute. The effect is object-relative, relative to the frame
of reference of the original position and orientation. To make an absolute change to the transformation,
use the <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method.</p>
<p class="- topic/p ">When the <codeph class="+ topic/ph pr-d/codeph ">prependRotation()</codeph> method's transformation is applied to a Matrix3D object
of a display object, the cached rotation property values of the display object are invalidated.</p>
<p class="- topic/p ">One way to have a display object rotate around a specific point relative to its location is
to set the translation of the object to the specified point, rotate the object using
the <codeph class="+ topic/ph pr-d/codeph ">prependRotation()</codeph> method, and translate the object back to the original position.
In the following example, the <codeph class="+ topic/ph pr-d/codeph ">myObject</codeph> 3D display object makes a y-axis rotation around
the coordinate (10,10,0).</p>
<codeblock rev="3.0" xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
myObject.z = 1;
myObject.transform.matrix3D.prependTranslation(10,10,0);
myObject.transform.matrix3D.prependRotation(1, Vector3D.Y_AXIS);
myObject.transform.matrix3D.prependTranslation(-10,-10,0);
</codeblock>
</apiDesc><example conref="examples\Matrix3DprependRotationExample.as" class="- topic/example "> In this example, the user can move a mouse to rotate an ellipse
around its <i class="+ topic/ph hi-d/i ">x</i> and <i class="+ topic/ph hi-d/i ">y</i> axes. The ellipse is drawn
with its registration point in its center. The ellipse rotates
around its <i class="+ topic/ph hi-d/i ">y</i> axis using the mouse's <i class="+ topic/ph hi-d/i ">x</i> coordinate.
It rotates around its <i class="+ topic/ph hi-d/i ">x</i> axis using the mouse's <i class="+ topic/ph hi-d/i ">y</i> coordinate.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.MovieClip;
import flash.display.Shape;
import flash.geom.*;
import flash.events.MouseEvent;
public class Matrix3DprependRotationExample extends MovieClip {
private var ellipse:Shape = new Shape();
public function Matrix3DprependRotationExample():void {
ellipse.graphics.beginFill(0xFF0000);
ellipse.graphics.lineStyle(2);
ellipse.graphics.drawEllipse(-50, -40, 100, 80);
ellipse.graphics.endFill();
ellipse.x = (this.stage.stageWidth / 2);
ellipse.y = (this.stage.stageHeight / 2);
ellipse.z = 1;
addChild(ellipse);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
private function mouseMoveHandler(e:MouseEvent):void {
var y:int;
var x:int;
if(e.localX &gt; ellipse.x) {
y = (Math.round(e.localX) / 100);
} else {
y = -(Math.round(e.localX) / 10);
}
if(e.localY &gt; ellipse.y) {
x = (Math.round(e.localY) / 100);
} else {
x = -(Math.round(e.localY) / 100);
}
ellipse.transform.matrix3D.prependRotation(y, Vector3D.Y_AXIS);
ellipse.transform.matrix3D.prependRotation(x, Vector3D.X_AXIS);
}
}
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/appendRotation()" class="- topic/link "><linktext class="- topic/linktext ">appendRotation()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:prependScale" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">prependScale</apiName><shortdesc class="- topic/shortdesc ">
Prepends an incremental scale change along the x, y, and z axes to a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">xScale</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the x axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">yScale</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the y axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">zScale</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the z axis.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Prepends an incremental scale change along the x, y, and z axes to a Matrix3D object.
When the Matrix3D object is applied to a display object, the matrix performs
the scale changes before other transformations in the Matrix3D object. The changes are
object-relative, relative to the frame of reference of the original position and orientation.
The default scale factor is (1.0, 1.0, 1.0).
<p class="- topic/p ">The scale is defined as a set of three incremental changes along the three axes (x,y,z).
You can multiply each axis with a different number. When the scale changes are applied to
a display object, the object's size increases or decreases. For example, setting
the x, y, and z axes to two doubles the size of the object, while
setting the axes to <codeph class="+ topic/ph pr-d/codeph ">0.5</codeph> halves the size. To make sure that
the scale transformation only affects a specific axis, set the other parameters to one.
A parameter of one means no scale change along the specific axis.</p>
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">prependScale()</codeph> method can be used for resizing as well as
for managing distortions, such as stretch or contract of a display object. It can also be
used for zooming in and out on a location. Scale transformations are automatically
performed during a display object's rotation and translation.</p>
<p class="- topic/p ">The order of transformation matters. A resizing followed by a translation transformation
produces a different effect than a translation followed by a resizing transformation.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/appendScale()" class="- topic/link "><linktext class="- topic/linktext ">appendScale()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:prependTranslation" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">prependTranslation</apiName><shortdesc class="- topic/shortdesc ">
Prepends an incremental translation, a repositioning along the x, y,
and z axes, to a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">x</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An incremental translation along the x axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">y</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An incremental translation along the y axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">z</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An incremental translation along the z axis.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Prepends an incremental translation, a repositioning along the x, y,
and z axes, to a Matrix3D object. When the Matrix3D object is applied to a
display object, the matrix performs the translation changes before other transformations
in the Matrix3D object.
<p class="- topic/p ">Translation specifies the distance the display object moves from its current location along
the x, y, and z axes. The <codeph class="+ topic/ph pr-d/codeph ">prependTranslation()</codeph> method
sets the translation as a set of three incremental changes along the three axes (x,y,z).
To have a translation change only a specific axis, set the other parameters to zero.
A zero parameter means no change along the specific axis.</p>
<p class="- topic/p ">The translation changes are not absolute. The effect is object-relative, relative to the frame
of reference of the original position and orientation. To make an absolute change to the transformation
matrix, use the <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method. The order of transformation also matters. A translation
followed by a rotation transformation produces a different effect than a rotation followed by a translation
transformation. When <codeph class="+ topic/ph pr-d/codeph ">prependTranslation()</codeph> is used, the display object continues to move
in the direction it is facing, regardless of the other transformations. For example, if a display object
was facing toward a positive x axis, it continues to move in the direction specified
by the <codeph class="+ topic/ph pr-d/codeph ">prependTranslation()</codeph> method, regardless of how the object has been rotated. To make
translation changes occur after other transformations, use the <codeph class="+ topic/ph pr-d/codeph ">appendTranslation()</codeph> method.</p>
</apiDesc><example conref="examples\Matrix3DprependTranslationExample.as" class="- topic/example "> In this example, the user can push an ellipse up the stage's <i class="+ topic/ph hi-d/i ">y</i> axis
using a mouse. When the user moves the mouse over the ellipse, the ellipse
jumps ten coordinates up the <i class="+ topic/ph hi-d/i ">y</i> axis. When the mouse moves off of
the ellipse, if the ellipse has not reached the top, the ellipse again jumps
ten coordinates up the <i class="+ topic/ph hi-d/i ">y</i> axis. Once the ellipse reaches the top,
it is moved back to the bottom of the stage.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.geom.*;
import flash.events.MouseEvent;
public class Matrix3DprependTranslationExample extends MovieClip {
private var ellipse:Sprite = new Sprite();
public function Matrix3DprependTranslationExample():void {
ellipse.x = this.stage.stageWidth / 2;
ellipse.y = this.stage.stageHeight - 100;
ellipse.z = 1;
ellipse.graphics.beginFill(0xFF0000);
ellipse.graphics.lineStyle(2);
ellipse.graphics.drawEllipse(0, 0, 60, 50);
ellipse.graphics.endFill();
addChild(ellipse);
ellipse.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
ellipse.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
}
private function mouseOverHandler(e:MouseEvent):void {
if(ellipse.y &gt; 0) {
ellipse.transform.matrix3D.prependTranslation(0, -10, 0);
}
}
private function mouseOutHandler(e:MouseEvent):void {
if(ellipse.y &gt; 0) {
ellipse.transform.matrix3D.prependTranslation(0, -10, 0);
} else {
ellipse.transform.matrix3D.prependTranslation(0,
(this.stage.stageHeight - 100), 0);
}
}
}
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/appendTranslation()" class="- topic/link "><linktext class="- topic/linktext ">appendTranslation()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:prepend" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">prepend</apiName><shortdesc class="- topic/shortdesc ">
Prepends a matrix by multiplying the current Matrix3D object by another Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">rhs</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A right-hand-side of the matrix by which the current Matrix3D is multiplied.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Prepends a matrix by multiplying the current Matrix3D object by another Matrix3D object.
The result combines both matrix transformations.
<p class="- topic/p ">Matrix multiplication is different from matrix addition. Matrix multiplication is not commutative.
In other words, A times B is not equal to B times A. With the <codeph class="+ topic/ph pr-d/codeph ">prepend()</codeph> method,
the multiplication happens from the right side, meaning the <codeph class="+ topic/ph pr-d/codeph ">rhs</codeph> Matrix3D object is
on the right side of the multiplication operator.</p>
<codeph class="+ topic/ph pr-d/codeph ">thisMatrix = thisMatrix ~~ rhs</codeph>
<p class="- topic/p ">The modifications made by <codeph class="+ topic/ph pr-d/codeph ">prepend()</codeph> method are object-space-relative. In other words,
they are always relative to the object's initial frame of reference.</p>
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">prepend()</codeph> method replaces the current matrix with the prepended matrix.
If you want to prepend two matrixes without altering the current matrix, first copy the
current matrix by using the <codeph class="+ topic/ph pr-d/codeph ">clone()</codeph> method and then apply the <codeph class="+ topic/ph pr-d/codeph ">prepend()</codeph>
method to the copy.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/append()" class="- topic/link "><linktext class="- topic/linktext ">append()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:recompose" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">recompose</apiName><shortdesc class="- topic/shortdesc ">
Sets the transformation matrix's translation, rotation, and scale settings.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Returns <codeph class="+ topic/ph pr-d/codeph ">false</codeph> if any of the scale elements are zero.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">components</apiItemName><apiType value="Vector$flash.geom:Vector3D" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector of three Vector3D objects that replace the Matrix3D
object's translation, rotation, and scale elements.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">orientationStyle</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">eulerAngles</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">An optional parameter that determines the orientation style
used for the matrix transformation. The three types of orientation styles are
<codeph class="+ topic/ph pr-d/codeph ">eulerAngles</codeph> (constant <codeph class="+ topic/ph pr-d/codeph ">EULER_ANGLES</codeph>), <codeph class="+ topic/ph pr-d/codeph ">axisAngle</codeph>
(constant <codeph class="+ topic/ph pr-d/codeph ">AXIS_ANGLE</codeph>), and <codeph class="+ topic/ph pr-d/codeph ">quaternion</codeph> (constant <codeph class="+ topic/ph pr-d/codeph ">QUATERNION</codeph>).
For additional information on the different orientation style, see the <codeph class="+ topic/ph pr-d/codeph ">geom.Orientation3D</codeph> class.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Sets the transformation matrix's translation, rotation, and scale settings.
Unlike the incremental changes made by the display object's rotation properties or
Matrix3D object's rotation methods, the changes made by <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method
are absolute changes. The <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method overwrites the matrix's transformation.
<p class="- topic/p ">To modify the matrix's transformation with an absolute parent frame of reference, retrieve
the settings with the <codeph class="+ topic/ph pr-d/codeph ">decompose()</codeph> method and make the appropriate changes. You can then
set the Matrix3D object to the modified transformation using the <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method.</p>
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> method's parameter specifies the orientation style that was used
for the transformation. The default orientation is <codeph class="+ topic/ph pr-d/codeph ">eulerAngles</codeph>,
which defines the orientation with three separate angles of rotation for each axis.
The rotations occur consecutively and do not change the axis of each other. The
display object's axis rotation properties perform Euler Angles orientation style transformation.
The other orientation style options are <codeph class="+ topic/ph pr-d/codeph ">axisAngle</codeph> and <codeph class="+ topic/ph pr-d/codeph ">quaternion</codeph>.
The Axis Angle orientation uses the combination of an axis and an angle to determine the orientation.
The axis around which the object is rotated is a unit vector that represents a direction.
The angle represents the magnitude of the rotation about the vector. The direction also
determines where a display object is facing and the angle determines which way is up.
The <codeph class="+ topic/ph pr-d/codeph ">appendRotation()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">prependRotation()</codeph> methods use the Axis Angle orientation.
The quaternion orientation uses complex numbers and the fourth element of a vector.
An orientation is represented by the three axes of rotation (x,y,z) and an angle of
rotation (w). The <codeph class="+ topic/ph pr-d/codeph ">interpolate()</codeph> method uses quaternion.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Orientation3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Orientation3D</linktext></link><link href="flash.geom.xml#Matrix3D/decompose()" class="- topic/link "><linktext class="- topic/linktext ">decompose()</linktext></link><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:transformVector" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">transformVector</apiName><shortdesc class="- topic/shortdesc ">
Uses the transformation matrix to transform a Vector3D object from one space coordinate
to another.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object with the transformed coordinates.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">v</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Vector3D</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector3D object holding the coordinates that are going to be transformed.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Uses the transformation matrix to transform a Vector3D object from one space coordinate
to another. The returned Vector3D object holds the new coordinates after the transformation.
All the matrix transformations including translation are applied to the Vector3D object.
<p class="- topic/p ">If the result of the <codeph class="+ topic/ph pr-d/codeph ">transformVector()</codeph> method was applied to the position
of a display object, only the display object's position changes.
The display object's rotation and scale elements remain the same.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/transformVectors()" class="- topic/link "><linktext class="- topic/linktext ">transformVectors()</linktext></link><link href="flash.geom.xml#Matrix3D/deltaTransformVector()" class="- topic/link "><linktext class="- topic/linktext ">deltaTransformVector()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:transformVectors" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">transformVectors</apiName><shortdesc class="- topic/shortdesc ">
Uses the transformation matrix to transform a Vector of Numbers from one
coordinate space to another.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">vin</apiItemName><apiType value="Vector$Number" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector of Numbers, where every three Numbers are a 3D coordinate
(x,y,z) that is going to be transformed.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">vout</apiItemName><apiType value="Vector$Number" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Vector of Numbers, where every three Numbers are a 3D
transformed coordinate (x,y,z).
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Uses the transformation matrix to transform a Vector of Numbers from one
coordinate space to another. The <codeph class="+ topic/ph pr-d/codeph ">tranformVectors()</codeph> method reads every
three Numbers in the <codeph class="+ topic/ph pr-d/codeph ">vin</codeph> Vector object as a 3D coordinate
(x,y,z) and places a transformed 3D coordinate in the <codeph class="+ topic/ph pr-d/codeph ">vout</codeph>
Vector object. All the matrix transformations including translation are applied to the
<codeph class="+ topic/ph pr-d/codeph ">vin</codeph> Vector object. You can use the <codeph class="+ topic/ph pr-d/codeph ">transformVectors()</codeph> method
to render and transform a 3D object as a mesh. A mesh is a collection of
vertices that defines the shape of the object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/transformVector()" class="- topic/link "><linktext class="- topic/linktext ">transformVector()</linktext></link><link href="flash.geom.xml#Matrix3D/deltaTransformVector()" class="- topic/link "><linktext class="- topic/linktext ">deltaTransformVector()</linktext></link><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix3D:transpose" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">transpose</apiName><shortdesc class="- topic/shortdesc ">
Converts the current Matrix3D object to a matrix where the rows and columns
are swapped.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Converts the current Matrix3D object to a matrix where the rows and columns
are swapped. For example, if the current Matrix3D object's <codeph class="+ topic/ph pr-d/codeph ">rawData</codeph> contains
the following 16 numbers, <codeph class="+ topic/ph pr-d/codeph ">1,2,3,4,11,12,13,14,21,22,23,24,31,32,33,34</codeph>,
the <codeph class="+ topic/ph pr-d/codeph ">transpose()</codeph> method reads every four elements as a row and turns the rows
into columns. The result is a matrix with the <codeph class="+ topic/ph pr-d/codeph ">rawData</codeph> of:
<codeph class="+ topic/ph pr-d/codeph ">1,11,21,31,2,12,22,32,3,13,23,33,4,14,24,34</codeph>.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">transpose()</codeph> method replaces the current matrix with a transposed matrix.
If you want to transpose a matrix without altering the current matrix, first copy the
current matrix by using the <codeph class="+ topic/ph pr-d/codeph ">clone()</codeph> method and then apply the <codeph class="+ topic/ph pr-d/codeph ">transpose()</codeph>
method to the copy.</p>
<p class="- topic/p ">An orthogonal matrix is a square matrix whose transpose is equal to its inverse.</p>
</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.geom:Matrix3D:determinant:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">determinant</apiName><shortdesc class="- topic/shortdesc ">
A Number that determines whether a matrix is invertible.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A Number that determines whether a matrix is invertible.
<p class="- topic/p ">A Matrix3D object must be invertible. You can use the <codeph class="+ topic/ph pr-d/codeph ">determinant</codeph>
property to make sure that a Matrix3D object is invertible. If determinant is zero,
an inverse of the matrix does not exist. For example, if an entire row or column
of a matrix is zero or if two rows or columns are equal, the determinant is zero.
Determinant is also used to solve a series of equations.</p>
<p class="- topic/p ">Only a square matrix, like the Matrix3D class, has a determinant.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/invert()" class="- topic/link "><linktext class="- topic/linktext ">invert()</linktext></link></related-links></apiValue><apiValue id="flash.geom:Matrix3D:position:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">position</apiName><shortdesc class="- topic/shortdesc ">
A Vector3D object that holds the position, the 3D coordinate (x,y,z) of a display object
within the transformation's frame of reference.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Vector3D</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A Vector3D object that holds the position, the 3D coordinate (x,y,z) of a display object
within the transformation's frame of reference. The <codeph class="+ topic/ph pr-d/codeph ">position</codeph> property provides immediate
access to the translation vector of the display object's matrix without needing to decompose and
recompose the matrix.
<p class="- topic/p ">With the <codeph class="+ topic/ph pr-d/codeph ">position</codeph> property, you can get and set the translation elements
of the transformation matrix.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/appendTranslation()" class="- topic/link "><linktext class="- topic/linktext ">appendTranslation()</linktext></link><link href="flash.geom.xml#Matrix3D/prependTranslation()" class="- topic/link "><linktext class="- topic/linktext ">prependTranslation()</linktext></link></related-links></apiValue><apiValue id="flash.geom:Matrix3D:rawData:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">rawData</apiName><shortdesc class="- topic/shortdesc ">
A Vector of 16 Numbers, where every four elements can be a row or
a column of a 4x4 matrix.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiType value="Vector$Number" name="type" class="- topic/state reference/state apiRef/apiType "/></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A Vector of 16 Numbers, where every four elements can be a row or
a column of a 4x4 matrix.
<p class="- topic/p ">An exception is thrown if the <codeph class="+ topic/ph pr-d/codeph ">rawData</codeph> property is set to a matrix
that is not invertible. The Matrix3D object must be invertible. If a non-invertible matrix
is needed, create a subclass of the Matrix3D object.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="#Vector" class="- topic/link "><linktext class="- topic/linktext ">Vector</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:Transform" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Transform</apiName><shortdesc class="- topic/shortdesc ">
The Transform class provides access to color adjustment properties and two- or three-dimensional
transformation objects that can be applied to a display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Provides access to color as well as two and three-dimensional transformation objects
and matrices that can be applied to a display object.
</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The Transform class provides access to color adjustment properties and two- or three-dimensional
transformation objects that can be applied to a display object. During the transformation,
the color or the orientation and position of a display object is adjusted (offset) from
the current values or coordinates to new values or coordinates.
The Transform class also collects data about color and two-dimensional matrix transformations
that are applied to a display object and all of its parent objects. You can access
these combined transformations through the <codeph class="+ topic/ph pr-d/codeph ">concatenatedColorTransform</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">concatenatedMatrix</codeph> properties.
<p class="- topic/p ">To apply color transformations: create a ColorTransform object,
set the color adjustments using the object's methods and properties, and then assign the
<codeph class="+ topic/ph pr-d/codeph ">colorTransformation</codeph> property of the <codeph class="+ topic/ph pr-d/codeph ">transform</codeph> property of the
display object to the new ColorTransformation object.</p>
<p class="- topic/p ">To apply two-dimensional transformations: create a Matrix object,
set the matrix's two-dimensional transformation, and then assign the <codeph class="+ topic/ph pr-d/codeph ">transform.matrix</codeph>
property of the display object to the new Matrix object.</p>
<p class="- topic/p ">To apply three-dimensional transformations: start with a three-dimensional display object.
A three-dimensional display object has a <codeph class="+ topic/ph pr-d/codeph ">z</codeph> property value other than zero.
You do not need to create the Matrix3D object. For all three-dimensional objects, a Matrix3D object
is created automatically when you assign a <codeph class="+ topic/ph pr-d/codeph ">z</codeph> value to a display object. You can
access the display object's Matrix3D object through the display object's <codeph class="+ topic/ph pr-d/codeph ">transform</codeph> property.
Using the methods of the Matrix3D class, you can add to or modify the existing transformation settings. Also, you can
create a custom Matrix3D object, set the custom Matrix3D object's transformation elements,
and then assign the new Matrix3D object to the display object using the <codeph class="+ topic/ph pr-d/codeph ">transform.matrix</codeph>
property.</p>
<p class="- topic/p ">To modify a perspective projection of the stage or root object:
use the <codeph class="+ topic/ph pr-d/codeph ">transform.matrix</codeph> property of the root display object to gain access to the
PerspectiveProjection object. Or, apply different perspective projection
properties to a display object by setting the perspective projection properties of the display
object's parent. The child display object inherits the new properties. Specifically, create a
PerspectiveProjection object and set its properties, then assign the PerspectiveProjection
object to the <codeph class="+ topic/ph pr-d/codeph ">perspectiveProjection</codeph> property of the parent display object's
<codeph class="+ topic/ph pr-d/codeph ">transform</codeph> property. The specified projection transformation then applies
to all the display object's three-dimensional children.</p>
<p class="- topic/p ">Since both PerspectiveProjection and Matrix3D objects perform perspective transformations,
do not assign both to a display object at the same time. Use the PerspectiveProjection object
for focal length and projection center changes. For more control over the perspective transformation,
create a perspective projection Matrix3D object.</p>
</apiDesc><example conref="examples\TransformExample.as" class="- topic/example "> The following example uses the TransformExample class to skew the bottom side
of a square sprite filled with a gradient pattern. Each time the user clicks the square, the
application transforms the sprite by skewing it with the following steps:
<ol class="- topic/ol "><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">TransformExample()</codeph> constructor creates a new sprite object <codeph class="+ topic/ph pr-d/codeph ">target</codeph>.</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">TransformExample()</codeph> constructor calls the <codeph class="+ topic/ph pr-d/codeph ">draw()</codeph> method,
which draws a gradient square in the sprite.</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">TransformExample()</codeph> constructor adds a click event listener for the sprite,
which is handled by the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method. </li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method creates a new Matrix object, <codeph class="+ topic/ph pr-d/codeph ">skewMatrix</codeph>,
which is set to apply a skew effect. Another matrix, <codeph class="+ topic/ph pr-d/codeph ">tempMatrix</codeph>, is assigned to the
current transformation matrix of the sprite, and then is combined with <codeph class="+ topic/ph pr-d/codeph ">skewMatrix</codeph>
using the <codeph class="+ topic/ph pr-d/codeph ">concat()</codeph> method. This matrix is assigned to the
<codeph class="+ topic/ph pr-d/codeph ">transform.matrix</codeph> property of the square sprite. Each time the user clicks the square,
the call to the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> modifies the shape of the square by skewing it. </li><li class="- topic/li ">Additionally, the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method creates a new ColorTransform object. The
<codeph class="+ topic/ph pr-d/codeph ">redOffset</codeph> property of the new ColorTransform is set to the current value of redOffset and
increased by 25. Likewise, the <codeph class="+ topic/ph pr-d/codeph ">blueOffset</codeph> property is reduced by 25. With each click,
the colors of the sprite change. </li></ol>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.Sprite;
import flash.display.GradientType;
import flash.geom.Matrix;
import flash.geom.ColorTransform;
import flash.events.MouseEvent;
public class TransformExample extends Sprite {
public function TransformExample() {
var target:Sprite = new Sprite();
draw(target);
addChild(target);
target.useHandCursor = true;
target.buttonMode = true;
target.addEventListener(MouseEvent.CLICK, clickHandler)
}
public function draw(sprite:Sprite):void {
var red:uint = 0xFF0000;
var green:uint = 0x00FF00;
var blue:uint = 0x0000FF;
var size:Number = 100;
sprite.graphics.beginGradientFill(GradientType.LINEAR, [red, blue, green], [1, 0.5, 1], [0, 200, 255]);
sprite.graphics.drawRect(0, 0, 100, 100);
}
public function clickHandler(event:MouseEvent):void {
var skewMatrix:Matrix = new Matrix();
skewMatrix.c = 0.25;
var tempMatrix:Matrix = this.transform.matrix;
tempMatrix.concat(skewMatrix);
this.transform.matrix = tempMatrix;
var rOffset:Number = this.transform.colorTransform.redOffset + 25;
var bOffset:Number = this.transform.colorTransform.blueOffset - 25;
this.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOffset, 0, bOffset, 0);
}
}
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObject/transform" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject.transform</linktext></link><link href="flash.geom.xml#ColorTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.ColorTransform</linktext></link><link href="flash.geom.xml#Matrix" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix</linktext></link><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link><link href="flash.geom.xml#PerspectiveProjection" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.PerspectiveProjection</linktext></link></related-links><apiOperation id="flash.geom:Transform:getRelativeMatrix3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getRelativeMatrix3D</apiName><shortdesc class="- topic/shortdesc ">
Returns a Matrix3D object, which can transform the space of a specified
display object in relation to the current display object's space.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Matrix3D object that can be used to transform the space from the <codeph class="+ topic/ph pr-d/codeph ">relativeTo</codeph>
display object to the current display object space.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">relativeTo</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.display:DisplayObject</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The display object relative to which the transformation occurs.
To get a Matrix3D object relative to the stage, set the parameter to the <codeph class="+ topic/ph pr-d/codeph ">root</codeph>
or <codeph class="+ topic/ph pr-d/codeph ">stage</codeph> object. To get the world-relative matrix of the display object,
set the parameter to a display object that has a perspective transformation applied to it.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a Matrix3D object, which can transform the space of a specified
display object in relation to the current display object's space. You can use the
<codeph class="+ topic/ph pr-d/codeph ">getRelativeMatrix3D()</codeph> method to move one three-dimensional display
object relative to another three-dimensional display object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link></related-links></apiOperation><apiValue id="flash.geom:Transform:colorTransform:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">colorTransform</apiName><shortdesc class="- topic/shortdesc ">
A ColorTransform object containing values that universally adjust the colors in
the display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example applies the ColorTransform object <code>blueColorTransform</code> to
the Transform object <code>trans</code>. This ColorTransform converts the color of the MovieClip
<code>rect</code> from red to blue.
<listing version="2.0">
import flash.geom.Transform;
import flash.geom.ColorTransform;
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var trans:Transform = new Transform(rect);
trace(trans.colorTransform);
// (redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
var blueColorTransform:ColorTransform = new ColorTransform(0, 1, 1, 1, 0, 0, 255, 0);
parentTrans.colorTransform = blueColorTransform;
trace(trans.colorTransform);
// (redMultiplier=0, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=255, alphaOffset=0)
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:ColorTransform</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The colorTransform is null when being set
</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A ColorTransform object containing values that universally adjust the colors in
the display object.
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#ColorTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.ColorTransform</linktext></link></related-links></apiValue><apiValue id="flash.geom:Transform:concatenatedColorTransform:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">concatenatedColorTransform</apiName><shortdesc class="- topic/shortdesc ">
A ColorTransform object representing the combined color transformations applied to the display object
and all of its parent objects, back to the root level.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example applies two Transform objects to both a parent and child MovieClip.
A <code>blueColorTransform</code> is then applied to the Transform object <code>parentTrans</code> which
adjusts the color of both parent and child MovieClips towards blue. Notice how <code>child.concatenatedColorTransform</code> is the
combination of <code>parentTrans</code> and <code>childTrans</code>.
<listing version="2.0">
import flash.geom.Transform;
import flash.geom.ColorTransform;
var parentRect:MovieClip = createRectangle(20, 80, 0xFF0000);
var childRect:MovieClip = createRectangle(10, 40, 0x00FF00, parentRect);
var parentTrans:Transform = new Transform(parentRect);
var childTrans:Transform = new Transform(childRect);
var blueColorTransform:ColorTransform = new ColorTransform(0, 1, 1, 1, 0, 0, 255, 0);
parentTrans.colorTransform = blueColorTransform;
trace(childTrans.concatenatedColorTransform);
// (redMultiplier=0, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=255, alphaOffset=0)
trace(childTrans.colorTransform);
// (redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
trace(parentTrans.concatenatedColorTransform);
// (redMultiplier=0, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=255, alphaOffset=0)
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:ColorTransform</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A ColorTransform object representing the combined color transformations applied to the display object
and all of its parent objects, back to the root level.
If different color transformations have been applied at different levels, all of those transformations are
concatenated into one ColorTransform object
for this property.
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#ColorTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.ColorTransform</linktext></link></related-links></apiValue><apiValue id="flash.geom:Transform:concatenatedMatrix:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">concatenatedMatrix</apiName><shortdesc class="- topic/shortdesc ">
A Matrix object representing the combined transformation matrixes of the
display object and all of its parent objects, back to the root level.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example applies two Transform objects to a parent movie clip and to a child movie clip.
A <code>scaleMatrix</code> is then applied to the Transform object <code>parentTrans</code> which
scales both parent and child MovieClips. Notice how <code>child.concatenatedMatrix</code> is the
combination of <code>parentTrans</code> and <code>childTrans</code>.
<listing version="2.0">
import flash.geom.Transform;
import flash.geom.Matrix;
var parentRect:MovieClip = createRectangle(20, 80, 0xFF0000);
var childRect:MovieClip = createRectangle(10, 40, 0x00FF00, parentRect);
var parentTrans:Transform = new Transform(parentRect);
var childTrans:Transform = new Transform(childRect);
var scaleMatrix:Matrix = new Matrix();
scaleMatrix.scale(2, 2);
parentTrans.matrix = scaleMatrix;
trace(childTrans.concatenatedMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
trace(childTrans.matrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
trace(parentTrans.concatenatedMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Matrix</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A Matrix object representing the combined transformation matrixes of the
display object and all of its parent objects, back to the root level.
If different transformation matrixes have been applied at different levels,
all of those matrixes are concatenated into one matrix
for this property. Also, for resizeable SWF content running in the browser,
this property factors in the difference between stage coordinates and window
coordinates due to window resizing. Thus, the property converts local coordinates
to window coordinates, which may not be the same coordinate space as that of
the Stage.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Transform:matrix3D:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">matrix3D</apiName><shortdesc class="- topic/shortdesc ">
Provides access to the Matrix3D object of a three-dimensional display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Matrix3D</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Provides access to the Matrix3D object of a three-dimensional display object.
The Matrix3D object represents a transformation matrix that determines the
display object's position and orientation. A Matrix3D object can also
perform perspective projection.
<p class="- topic/p ">If the <codeph class="+ topic/ph pr-d/codeph ">matrix</codeph> property is set to a value (not <codeph class="+ topic/ph pr-d/codeph ">null</codeph>), the
<codeph class="+ topic/ph pr-d/codeph ">matrix3D</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>. And if the <codeph class="+ topic/ph pr-d/codeph ">matrix3D</codeph> property
is set to a value (not <codeph class="+ topic/ph pr-d/codeph ">null</codeph>), the <codeph class="+ topic/ph pr-d/codeph ">matrix</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link></related-links></apiValue><apiValue id="flash.geom:Transform:matrix:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">matrix</apiName><shortdesc class="- topic/shortdesc ">
A Matrix object containing values that alter the scaling, rotation,
and translation of the display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example applies the Matrix object <code>scaleMatrix</code> to the Transform
object <code>trans</code>. This Matrix scales the MovieClip <code>rect</code> by a factor of two.
<listing version="2.0">
import flash.geom.Transform;
import flash.geom.Matrix;
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var trans:Transform = new Transform(rect);
trace(trans.matrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
var scaleMatrix:Matrix = new Matrix();
scaleMatrix.scale(2, 2);
trans.matrix = scaleMatrix;
trace(trans.matrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Matrix</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The matrix is null when being set
</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A Matrix object containing values that alter the scaling, rotation,
and translation of the display object.
<p class="- topic/p ">If the <codeph class="+ topic/ph pr-d/codeph ">matrix</codeph> property is set to a value (not <codeph class="+ topic/ph pr-d/codeph ">null</codeph>), the
<codeph class="+ topic/ph pr-d/codeph ">matrix3D</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>. And if the <codeph class="+ topic/ph pr-d/codeph ">matrix3D</codeph> property
is set to a value (not <codeph class="+ topic/ph pr-d/codeph ">null</codeph>), the <codeph class="+ topic/ph pr-d/codeph ">matrix</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix</linktext></link></related-links></apiValue><apiValue id="flash.geom:Transform:perspectiveProjection:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">perspectiveProjection</apiName><shortdesc class="- topic/shortdesc ">
Provides access to the PerspectiveProjection object of a three-dimensional display
object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:PerspectiveProjection</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Provides access to the PerspectiveProjection object of a three-dimensional display
object. The PerspectiveProjection object can be used to modify the perspective
transformation of the stage or to assign a perspective transformation to all the
three-dimensional children of a display object.
<p class="- topic/p ">Based on the field of view and aspect ratio (dimensions) of the stage, a
default PerspectiveProjection object is assigned to the root object.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#PerspectiveProjection" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.PerspectiveProjection</linktext></link></related-links></apiValue><apiValue id="flash.geom:Transform:pixelBounds:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">pixelBounds</apiName><shortdesc class="- topic/shortdesc ">
A Rectangle object that defines the bounding rectangle of the display object on the stage.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a Transform object <code>trans</code> and traces out
its <code>pixelBounds</code>. Notice that pixel bounds returns a bounding box with values
equal to MovieClip's <code>getBounds()</code> and <code>getRect()</code> methods.
<listing version="2.0">
import flash.geom.Transform;
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var trans:Transform = new Transform(rect);
trace(trans.pixelBounds); // (x=0, y=0, w=20, h=80)
var boundsObj:Object = rect.getBounds();
trace(boundsObj.xMin); // 0
trace(boundsObj.yMin); // 0
trace(boundsObj.xMax); // 20
trace(boundsObj.yMax); // 80
var rectObj:Object = rect.getRect();
trace(rectObj.xMin); // 0
trace(rectObj.yMin); // 0
trace(rectObj.xMax); // 20
trace(rectObj.yMax); // 80
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Rectangle</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A Rectangle object that defines the bounding rectangle of the display object on the stage.
</apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:Matrix" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Matrix</apiName><shortdesc class="- topic/shortdesc ">
The Matrix class represents a transformation matrix that determines how to map points from one
coordinate space to another.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">A standard two-dimensional homogeneous Matrix class.
</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The Matrix class represents a transformation matrix that determines how to map points from one
coordinate space to another. You can perform various graphical
transformations on a display object by setting the properties of a Matrix object,
applying that Matrix object to the <codeph class="+ topic/ph pr-d/codeph ">matrix</codeph> property of a Transform object,
and then applying that Transform object as the <codeph class="+ topic/ph pr-d/codeph ">transform</codeph> property of the display object.
These transformation functions include translation
(<i class="+ topic/ph hi-d/i ">x</i> and <i class="+ topic/ph hi-d/i ">y</i> repositioning), rotation, scaling, and skewing.
<p class="- topic/p ">Together these types of transformations are known as <i class="+ topic/ph hi-d/i ">affine transformations</i>.
Affine transformations preserve the straightness of lines while transforming, so that
parallel lines stay parallel.</p>
<p class="- topic/p ">To apply a transformation matrix to a display object, you create a Transform
object, set its <codeph class="+ topic/ph pr-d/codeph ">matrix</codeph> property to the transformation matrix, and then set the <codeph class="+ topic/ph pr-d/codeph ">transform</codeph>
property of the display object to the Transform object.
Matrix objects are also used as parameters of some methods, such as the following:</p>
<ul class="- topic/ul "><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">draw()</codeph> method of a BitmapData object</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">beginBitmapFill()</codeph> method, <codeph class="+ topic/ph pr-d/codeph ">beginGradientFill()</codeph> method,
or <codeph class="+ topic/ph pr-d/codeph ">lineGradientStyle()</codeph> method of a Graphics object</li></ul>
<p class="- topic/p ">A transformation matrix object is a 3 x 3 matrix with the following contents:</p>
<p class="- topic/p "><adobeimage alt="Matrix class properties in matrix notation" href="../../images/matrix_props1.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">In traditional transformation matrixes, the <codeph class="+ topic/ph pr-d/codeph ">u</codeph>, <codeph class="+ topic/ph pr-d/codeph ">v</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">w</codeph>
properties provide extra capabilities.
The Matrix class can only operate in two-dimensional space, so it always
assumes that the property values <codeph class="+ topic/ph pr-d/codeph ">u</codeph> and <codeph class="+ topic/ph pr-d/codeph ">v</codeph> are 0.0, and that the property value
<codeph class="+ topic/ph pr-d/codeph ">w</codeph> is 1.0. The effective values of the matrix are as follows:</p>
<p class="- topic/p "><adobeimage alt="Matrix class properties in matrix notation showing assumed values for u, v, and w" href="../../images/matrix_props2.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">You can get and set the values of all six of the other properties in a Matrix
object: <codeph class="+ topic/ph pr-d/codeph ">a</codeph>, <codeph class="+ topic/ph pr-d/codeph ">b</codeph>, <codeph class="+ topic/ph pr-d/codeph ">c</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">d</codeph>, <codeph class="+ topic/ph pr-d/codeph ">tx</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">ty</codeph>.</p>
<p class="- topic/p ">The Matrix class supports the four major types of transformations:
translation, scaling, rotation, and skewing. You can set three of these transformations by using
specialized methods, as described in the following table: </p>
<adobetable class="innertable"><tgroup cols="5" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry ">Transformation</entry><entry class="- topic/entry ">Method</entry><entry class="- topic/entry ">Matrix values</entry><entry class="- topic/entry ">Display result</entry><entry class="- topic/entry ">Description</entry></row></thead><tbody class="- topic/tbody "><row valign="top" class="- topic/row "><entry class="- topic/entry ">Translation (displacement)</entry><entry outputclass="nowrap" class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">translate(tx, ty)</codeph> </entry><entry class="- topic/entry "><adobeimage alt="Matrix notation of translate method parameters" height="104" href="../../images/matrix_translate.jpg" width="150" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry "><adobeimage alt="Illustration of translate method effects" height="91" href="../../images/matrix_translate_image.jpg" width="111" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry ">Moves the image <codeph class="+ topic/ph pr-d/codeph ">tx</codeph> pixels to the right and <codeph class="+ topic/ph pr-d/codeph ">ty</codeph> pixels
down.</entry></row><row valign="top" class="- topic/row "><entry class="- topic/entry ">Scaling</entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">scale(sx, sy)</codeph></entry><entry class="- topic/entry "><adobeimage alt="Matrix notation of scale method parameters" height="105" href="../../images/matrix_scale.jpg" width="140" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry "><adobeimage alt="Illustration of scale method effects" height="84" href="../../images/matrix_scale_image.jpg" width="111" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry ">Resizes the image, multiplying the location of each pixel by <codeph class="+ topic/ph pr-d/codeph ">sx</codeph> on the
<i class="+ topic/ph hi-d/i ">x</i> axis and <codeph class="+ topic/ph pr-d/codeph ">sy</codeph> on the <i class="+ topic/ph hi-d/i ">y</i> axis.</entry></row><row valign="top" class="- topic/row "><entry class="- topic/entry ">Rotation</entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">rotate(q)</codeph></entry><entry class="- topic/entry "><adobeimage alt="Matrix notation of rotate method properties" height="105" href="../../images/matrix_rotate.jpg" width="219" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry "><adobeimage alt="Illustration of rotate method effects" height="91" href="../../images/matrix_rotate_image.jpg" width="111" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry ">Rotates the image by an angle <codeph class="+ topic/ph pr-d/codeph ">q</codeph>, which is measured in radians.</entry></row><row valign="top" class="- topic/row "><entry class="- topic/entry ">Skewing or shearing </entry><entry class="- topic/entry ">None; must set the properties <codeph class="+ topic/ph pr-d/codeph ">b</codeph> and <codeph class="+ topic/ph pr-d/codeph ">c</codeph></entry><entry class="- topic/entry "><adobeimage alt="Matrix notation of skew function properties" href="../../images/matrix_skew.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry "><adobeimage alt="Illustration of skew function effects" height="77" href="../../images/matrix_skew_image.jpg" width="111" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry><entry class="- topic/entry ">Progressively slides the image in a direction parallel to the <i class="+ topic/ph hi-d/i ">x</i> or <i class="+ topic/ph hi-d/i ">y</i> axis. The <codeph class="+ topic/ph pr-d/codeph ">b</codeph>
property of the Matrix object represents the tangent of the skew angle along the <i class="+ topic/ph hi-d/i ">y</i> axis;
the <codeph class="+ topic/ph pr-d/codeph ">c</codeph> property of the Matrix object represents the tangent of the skew angle along the
<i class="+ topic/ph hi-d/i ">x</i> axis.</entry></row></tbody></tgroup></adobetable>
<p class="- topic/p ">Each transformation function alters the current matrix properties so that
you can effectively combine multiple transformations. To do this, you call more than one
transformation function before applying the matrix to its display object target (by using the
<codeph class="+ topic/ph pr-d/codeph ">transform</codeph> property of that display object).</p>
<p class="- topic/p ">Use the <codeph class="+ topic/ph pr-d/codeph ">new Matrix()</codeph> constructor to create a
Matrix object before you can call the methods of the Matrix object.</p>
</apiDesc><example conref="examples\MatrixExample.as" class="- topic/example "> The following example uses the <codeph class="+ topic/ph pr-d/codeph ">MatrixExample</codeph> class to show
how a large gradient-filled square can be created. This is accomplished with the following
steps:
<ol class="- topic/ol "><li class="- topic/li ">The application creates a new Matrix object <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph>, and it uses the
<codeph class="+ topic/ph pr-d/codeph ">trace()</codeph> method to output
the default property values for the <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> object.</li><li class="- topic/li ">The application calls the <codeph class="+ topic/ph pr-d/codeph ">createGradientBox()</codeph> with the <codeph class="+ topic/ph pr-d/codeph ">width</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> parameters set to 200 pixels, no rotation, and the distance to translate along
the <i class="+ topic/ph hi-d/i ">x</i> and <i class="+ topic/ph hi-d/i ">y</i> axes set to 50 pixels.</li><li class="- topic/li ">The application prints the <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> object again to show the change after calling
<codeph class="+ topic/ph pr-d/codeph ">createGradientBox()</codeph>.</li><li class="- topic/li ">The application sets up three variables to control how the gradient box is filled:
<ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">colors</codeph>: Sets the gradient colors to range between solid red and solid blue.</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">alphas</codeph>: Sets the opacity to solid.</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">ratios</codeph>: Sets the distribution of the colors to be equal for both red and blue.</li></ul></li><li class="- topic/li ">The application calls the graphics method <codeph class="+ topic/ph pr-d/codeph ">beginGradientFill()</codeph>, which operates on the <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph>
object, and it calls the <codeph class="+ topic/ph pr-d/codeph ">lineTo()</codeph> method, resulting in the gradient-filled box.</li></ol>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.geom.Matrix;
import flash.display.Sprite;
import flash.display.GradientType;
public class MatrixExample extends Sprite {
public function MatrixExample() {
var myMatrix:Matrix = new Matrix();
trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.createGradientBox(200, 200, 0, 50, 50);
trace(myMatrix.toString()); // (a=0.1220703125, b=0, c=0, d=0.1220703125, tx=150, ty=150)
var colors:Array = [0xFF0000, 0x0000FF];
var alphas:Array = [1, 1];
var ratios:Array = [0, 0xFF];
graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, myMatrix);
graphics.lineTo(0, 300);
graphics.lineTo(300, 300);
graphics.lineTo(300, 0);
graphics.lineTo(0, 0);
}
}
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObject/transform" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject.transform</linktext></link><link href="flash.geom.xml#Transform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Transform</linktext></link><link href="flash.display.xml#BitmapData/draw()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.BitmapData.draw()</linktext></link><link href="flash.display.xml#Graphics/beginBitmapFill()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics.beginBitmapFill()</linktext></link><link href="flash.display.xml#Graphics/beginGradientFill()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics.beginGradientFill()</linktext></link><link href="flash.display.xml#Graphics/lineGradientStyle()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics.lineGradientStyle()</linktext></link></related-links><apiConstructor id="flash.geom:Matrix:Matrix" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Matrix</apiName><shortdesc class="- topic/shortdesc ">
Creates a new Matrix object with the specified parameters.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">a</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">x</i> axis when scaling or rotating an image.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">b</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">y</i> axis when rotating or skewing an image.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">c</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">x</i> axis when rotating or skewing an image.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">d</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">y</i> axis when scaling or rotating an image..
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">tx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The distance by which to translate each point along the <i class="+ topic/ph hi-d/i ">x</i> axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ty</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The distance by which to translate each point along the <i class="+ topic/ph hi-d/i ">y</i> axis.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Creates a new two-dimensional Matrix object.
</apiTipText></apiTipTexts></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates a new Matrix object with the specified parameters. In matrix notation, the properties
are organized like this:
<p class="- topic/p "><adobeimage alt="Matrix class properties in matrix notation showing assumed values for u, v, and w" href="../../images/matrix_props2.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">If you do not provide any parameters to the <codeph class="+ topic/ph pr-d/codeph ">new Matrix()</codeph> constructor, it creates an
<i class="+ topic/ph hi-d/i ">identity matrix</i> with the following values:</p>
<adobetable class="innertable"><tgroup cols="2" class="- topic/tgroup "><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">a = 1</pre></entry><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">b = 0</pre></entry></row><row class="- topic/row "><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">c = 0</pre></entry><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">d = 1</pre></entry></row><row class="- topic/row "><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">tx = 0</pre></entry><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">ty = 0</pre></entry></row></tbody></tgroup></adobetable>
<p class="- topic/p ">In matrix notation, the identity matrix looks like this:</p>
<p class="- topic/p "><adobeimage alt="Matrix class properties in matrix notation" href="../../images/matrix_identity.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc><example conref="examples\Matrix.1.as" class="- topic/example "> The following example creates <codeph class="+ topic/ph pr-d/codeph ">matrix_1</codeph> by sending no parameters to the
<codeph class="+ topic/ph pr-d/codeph ">Matrix()</codeph> constructor and <codeph class="+ topic/ph pr-d/codeph ">matrix_2</codeph> by sending parameters to it. Notice that
<codeph class="+ topic/ph pr-d/codeph ">matrix_1</codeph>, which was created with no parameters, results in an identity matrix with the values
<codeph class="+ topic/ph pr-d/codeph ">a</codeph>=1, <codeph class="+ topic/ph pr-d/codeph ">b</codeph>=0, <codeph class="+ topic/ph pr-d/codeph ">c</codeph>=0, <codeph class="+ topic/ph pr-d/codeph ">d</codeph>=1, <codeph class="+ topic/ph pr-d/codeph ">tx</codeph>=0,
<codeph class="+ topic/ph pr-d/codeph ">ty</codeph>=0.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var matrix_1:Matrix = new Matrix();
trace(matrix_1); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
var matrix_2:Matrix = new Matrix(1, 2, 3, 4, 5, 6);
trace(matrix_2); // (a=1, b=2, c=3, d=4, tx=5, ty=6)
</codeblock></example></apiConstructorDetail></apiConstructor><apiOperation id="flash.geom:Matrix:clone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">clone</apiName><shortdesc class="- topic/shortdesc ">
Returns a new Matrix object that is a clone of this
matrix, with an exact copy of the contained object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates <code>clonedMatrix</code> from <code>myMatrix</code>.
Notice that the Matrix class does not have an equals method, so the following example
uses a custom written function to test the equality of two Matricies.
<listing version="2.0">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix(2, 0, 0, 2, 0, 0);
var clonedMatrix:Matrix = new Matrix();
trace(myMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
trace(clonedMatrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
trace(equals(myMatrix, clonedMatrix)); // false
clonedMatrix = myMatrix.clone();
trace(myMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
trace(clonedMatrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
trace(equals(myMatrix, clonedMatrix)); // true
function equals(m1:Matrix, m2:Matrix):Boolean {
return m1.toString() == m2.toString();
}
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Matrix object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Returns a new Matrix object that is a copy of the current matrix.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a new Matrix object that is a clone of this
matrix, with an exact copy of the contained object.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:concat" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">concat</apiName><shortdesc class="- topic/shortdesc ">
Concatenates a matrix with the current matrix, effectively combining the
geometric effects of the two.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates three Matricies that define transformations for
three rectangle MovieClips. The first two Matricies <code>rotate45Matrix</code>
and <code>doubleScaleMatrix</code> are applied to the two rectangles
<code>rectangleMc_1</code> and <code>rectangleMc_2</code>. Then, the third
Matrix is created using the <code>concat()</code> method on <code>rotate45Matrix</code> and
<code>doubleScaleMatrix</code> to create <code>scaleAndRotateMatrix</code>.
This Matrix is then applied to <code>rectangleMc_3</code> to scale and rotate it.
<listing version="2.0">
import flash.geom.Matrix;
import flash.geom.Transform;
var rectangleMc_0:MovieClip = createRectangle(20, 80, 0x000000);
var rectangleMc_1:MovieClip = createRectangle(20, 80, 0xFF0000);
var rectangleMc_2:MovieClip = createRectangle(20, 80, 0x00FF00);
var rectangleMc_3:MovieClip = createRectangle(20, 80, 0x0000FF);
var rectangleTrans_1:Transform = new Transform(rectangleMc_1);
var rectangleTrans_2:Transform = new Transform(rectangleMc_2);
var rectangleTrans_3:Transform = new Transform(rectangleMc_3);
var rotate45Matrix:Matrix = new Matrix();
rotate45Matrix.rotate(Math.PI/4);
rectangleTrans_1.matrix = rotate45Matrix;
rectangleMc_1._x = 100;
trace(rotate45Matrix.toString()); // (a=0.707106781186548, b=0.707106781186547, c=-0.707106781186547, d=0.707106781186548, tx=0, ty=0)
var doubleScaleMatrix:Matrix = new Matrix();
doubleScaleMatrix.scale(2, 2);
rectangleTrans_2.matrix = doubleScaleMatrix;
rectangleMc_2._x = 200;
trace(doubleScaleMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
var scaleAndRotateMatrix:Matrix = doubleScaleMatrix.clone();
scaleAndRotateMatrix.concat(rotate45Matrix);
rectangleTrans_3.matrix = scaleAndRotateMatrix;
rectangleMc_3._x = 300;
trace(scaleAndRotateMatrix.toString()); // (a=1.4142135623731, b=1.41421356237309, c=-1.41421356237309, d=1.4142135623731, tx=0, ty=0)
function createRectangle(width:Number, height:Number, color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">m</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The matrix to be concatenated to the source matrix.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Concatenates a matrix with the current matrix, effectively combining the
geometric effects of the two. In mathematical terms, concatenating two matrixes
is the same as combining them using matrix multiplication.
<p class="- topic/p ">For example, if matrix <codeph class="+ topic/ph pr-d/codeph ">m1</codeph> scales an object by a factor of four, and
matrix <codeph class="+ topic/ph pr-d/codeph ">m2</codeph> rotates an object by 1.5707963267949 radians
(<codeph class="+ topic/ph pr-d/codeph ">Math.PI/2</codeph>), then <codeph class="+ topic/ph pr-d/codeph ">m1.concat(m2)</codeph> transforms <codeph class="+ topic/ph pr-d/codeph ">m1</codeph>
into a matrix that scales an object by a factor of four and rotates the object by
<codeph class="+ topic/ph pr-d/codeph ">Math.PI/2</codeph> radians. </p>
<p class="- topic/p ">This method replaces the source matrix with the concatenated matrix. If you
want to concatenate two matrixes without altering either of the two source matrixes,
first copy the source matrix by using the <codeph class="+ topic/ph pr-d/codeph ">clone()</codeph> method, as shown in the Class Examples section.</p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:createBox" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">createBox</apiName><shortdesc class="- topic/shortdesc ">
Includes parameters for scaling,
rotation, and translation.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">scaleX</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The factor by which to scale horizontally.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">scaleY</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The factor by which scale vertically.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">rotation</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The amount to rotate, in radians.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">tx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The number of pixels to translate (move) to the right along the <i class="+ topic/ph hi-d/i ">x</i> axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ty</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The number of pixels to translate (move) down along the <i class="+ topic/ph hi-d/i ">y</i> axis.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Creates a Matrix with scaling, rotation, and translation values.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Includes parameters for scaling,
rotation, and translation. When applied to a matrix it sets the matrix's values
based on those parameters.
<p class="- topic/p ">Using the <codeph class="+ topic/ph pr-d/codeph ">createBox()</codeph> method lets you obtain the same matrix as you would if
you applied the <codeph class="+ topic/ph pr-d/codeph ">identity()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">rotate()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">scale()</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">translate()</codeph> methods
in succession. For example, <codeph class="+ topic/ph pr-d/codeph ">mat1.createBox(2,2,Math.PI/4, 100, 100)</codeph> has the
same effect as the following:</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var mat1:Matrix = new Matrix();
mat1.identity();
mat1.rotate(Math.PI/4);
mat1.scale(2,2);
mat1.translate(10,20);
</codeblock>
</apiDesc><example conref="examples\Matrix_createBox.as" class="- topic/example "> The following example sets the x scale, y scale, rotation, x location,
and y location of <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> by calling its <codeph class="+ topic/ph pr-d/codeph ">createBox()</codeph> method.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.geom.Matrix;
import flash.geom.Transform;
public class Matrix_createBox extends Sprite
{
public function Matrix_createBox()
{
var myMatrix:Matrix = new Matrix();
trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.createBox(1, 2, Math.PI/4, 50, 100);
trace(myMatrix.toString());
// (a=0.7071067811865476, b=1.414213562373095, c=-0.7071067811865475,
// d=1.4142135623730951, tx=100, ty=200)
var rectangleShape:Shape = createRectangle(20, 80, 0xFF0000);
addChild(rectangleShape);
var rectangleTrans:Transform = new Transform(rectangleShape);
rectangleTrans.matrix = myMatrix;
}
public function createRectangle(w:Number, h:Number, color:Number):Shape
{
var rect:Shape = new Shape();
rect.graphics.beginFill(color);
rect.graphics.drawRect(0, 0, w, h);
addChild(rect);
return rect;
}
}
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.display.xml#Graphics/beginBitmapFill()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics.beginBitmapFill()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix:createGradientBox" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">createGradientBox</apiName><shortdesc class="- topic/shortdesc ">
Creates the specific style of matrix expected by the beginGradientFill() and
lineGradientStyle() methods of the Graphics class.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><category class="- topic/category ">Method
</category></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">width</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The width of the gradient box.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">height</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The height of the gradient box.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">rotation</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The amount to rotate, in radians.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">tx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The distance, in pixels, to translate to the right along the <i class="+ topic/ph hi-d/i ">x</i> axis.
This value is offset by half of the <codeph class="+ topic/ph pr-d/codeph ">width</codeph> parameter.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ty</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The distance, in pixels, to translate down along the <i class="+ topic/ph hi-d/i ">y</i> axis.
This value is offset by half of the <codeph class="+ topic/ph pr-d/codeph ">height</codeph> parameter.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Creates the specific style of matrix expected by the beginGradientFill() method of the Graphics class.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates the specific style of matrix expected by the <codeph class="+ topic/ph pr-d/codeph ">beginGradientFill()</codeph> and
<codeph class="+ topic/ph pr-d/codeph ">lineGradientStyle()</codeph> methods of the Graphics class. Width and height are scaled to
a <codeph class="+ topic/ph pr-d/codeph ">scaleX</codeph>/<codeph class="+ topic/ph pr-d/codeph ">scaleY</codeph> pair and the <codeph class="+ topic/ph pr-d/codeph ">tx</codeph>/<codeph class="+ topic/ph pr-d/codeph ">ty</codeph>
values are offset by half the width and height.
<p class="- topic/p ">For example, consider a gradient with the following characteristics:</p>
<ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">GradientType.LINEAR</codeph></li><li class="- topic/li ">Two colors, green and blue, with the ratios array set to <codeph class="+ topic/ph pr-d/codeph ">[0, 255]</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">SpreadMethod.PAD</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">InterpolationMethod.LINEAR_RGB</codeph></li></ul>
<p class="- topic/p ">The following illustrations show gradients in which the matrix was defined using the
<codeph class="+ topic/ph pr-d/codeph ">createGradientBox()</codeph> method with different parameter settings:</p>
<adobetable class="innertable"><tgroup cols="2" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">createGradientBox()</codeph> settings</entry><entry class="- topic/entry ">Resulting gradient</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">width = 25;
height = 25;
rotation = 0;
tx = 0;
ty = 0;</pre></entry><entry align="center" class="- topic/entry "><adobeimage alt="resulting linear gradient" href="../../images/createGradientBox-1.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry></row><row class="- topic/row "><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">width = 25;
height = 25;
rotation = 0;
tx = 25;
ty = 0;</pre></entry><entry align="center" class="- topic/entry "><adobeimage alt="resulting linear gradient" href="../../images/createGradientBox-2.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry></row><row class="- topic/row "><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">width = 50;
height = 50;
rotation = 0;
tx = 0;
ty = 0;</pre></entry><entry align="center" class="- topic/entry "><adobeimage alt="resulting linear gradient" href="../../images/createGradientBox-3.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry></row><row class="- topic/row "><entry class="- topic/entry "><pre xml:space="preserve" class="- topic/pre ">width = 50;
height = 50;
rotation = Math.PI / 4; // 45 degrees
tx = 0;
ty = 0;</pre></entry><entry align="center" class="- topic/entry "><adobeimage alt="resulting linear gradient" href="../../images/createGradientBox-4.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></entry></row></tbody></tgroup></adobetable>
</apiDesc><example conref="examples\Matrix_createGradientBox.as" class="- topic/example "> The following example sets the x scale, y scale, rotation, x location,
and y location of <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> by calling its <codeph class="+ topic/ph pr-d/codeph ">createBox()</codeph> method.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package
{
import flash.display.GradientType;
import flash.display.Sprite;
import flash.geom.Matrix;
public class Matrix_createGradientBox extends Sprite
{
public function Matrix_createGradientBox()
{
var myMatrix:Matrix = new Matrix();
trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.createGradientBox(200, 200, 0, 50, 50);
trace(myMatrix.toString()); // (a=0.1220703125, b=0, c=0, d=0.1220703125, tx=150, ty=150)
var colors:Array = [0xFF0000, 0x0000FF];
var alphas:Array = [100, 100];
var ratios:Array = [0, 0xFF];
this.graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, myMatrix);
this.graphics.drawRect(0, 0, 300, 200);
}
}
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.display.xml#Graphics/beginGradientFill()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics.beginGradientFill()</linktext></link><link href="flash.display.xml#Graphics/lineGradientStyle()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Graphics.lineGradientStyle()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Matrix:deltaTransformPoint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">deltaTransformPoint</apiName><shortdesc class="- topic/shortdesc ">
Given a point in the pretransform coordinate space, returns the coordinates of
that point after the transformation occurs.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example uses the <code>deltaTransformPoint()</code> method
to create <code>deltaTransformedPoint</code> from <code>myPoint</code>. Notice that
the <code>translate()</code> method has no affect on the position of <code>deltaTransformedPoint</code>.
In the example, however, <code>scale()</code> does affect the position. It
increases the original <code>x</code> value by a factor of three from 50 to 150.
<listing version="2.0">
import flash.geom.Matrix;
import flash.geom.Point;
var myMatrix:Matrix = new Matrix();
trace(myMatrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.translate(100, 0);
trace(myMatrix); // (a=1, b=0, c=0, d=1, tx=100, ty=0)
myMatrix.scale(3, 3);
trace(myMatrix); // (a=3, b=0, c=0, d=3, tx=300, ty=0)
var myPoint:Point = new Point(50,0);
trace(myPoint); // (50, 0)
var deltaTransformedPoint:Point = myMatrix.deltaTransformPoint(myPoint);
trace(deltaTransformedPoint); // (150, 0)
var pointMc_0:MovieClip = createRectangle(10, 10, 0xFF0000);
pointMc_0._x = myPoint.x;
var pointMc_1:MovieClip = createRectangle(10, 10, 0x00FF00);
pointMc_1._x = deltaTransformedPoint.x;
function createRectangle(width:Number, height:Number, color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point resulting from applying the matrix transformation.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">point</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point for which you want to get the result of the matrix transformation.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Given a point in the pretransform coordinate space, returns the coordinates of
that point after the transformation occurs. Unlike the standard transformation applied using
the <codeph class="+ topic/ph pr-d/codeph ">transformPoint()</codeph> method, the <codeph class="+ topic/ph pr-d/codeph ">deltaTransformPoint()</codeph> method's
transformation does not consider the translation parameters <codeph class="+ topic/ph pr-d/codeph ">tx</codeph> and <codeph class="+ topic/ph pr-d/codeph ">ty</codeph>.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:identity" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">identity</apiName><shortdesc class="- topic/shortdesc ">
Sets each matrix property to a value that causes a null transformation.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><category class="- topic/category ">Method
</category></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Sets each matrix property to a value that causes a null transformation. An object transformed
by applying an identity matrix will be identical to the original.
<p class="- topic/p ">After calling the <codeph class="+ topic/ph pr-d/codeph ">identity()</codeph> method, the resulting matrix has the following properties:
<codeph class="+ topic/ph pr-d/codeph ">a</codeph>=1, <codeph class="+ topic/ph pr-d/codeph ">b</codeph>=0, <codeph class="+ topic/ph pr-d/codeph ">c</codeph>=0, <codeph class="+ topic/ph pr-d/codeph ">d</codeph>=1, <codeph class="+ topic/ph pr-d/codeph ">tx</codeph>=0, <codeph class="+ topic/ph pr-d/codeph ">ty</codeph>=0.</p>
<p class="- topic/p ">In matrix notation, the identity matrix looks like this:</p>
<p class="- topic/p "><adobeimage alt="Matrix class properties in matrix notation" href="../../images/matrix_identity.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:invert" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">invert</apiName><shortdesc class="- topic/shortdesc ">
Performs the opposite transformation
of the original matrix.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Performs the opposite transformation
of the original matrix. You can apply an inverted matrix to an object to undo the transformation
performed when applying the original matrix.
</apiDesc><example conref="examples\Matrix_invert.as" class="- topic/example "> The following example creates a <codeph class="+ topic/ph pr-d/codeph ">halfScaleMatrix</codeph> by calling the
<codeph class="+ topic/ph pr-d/codeph ">invert()</codeph> method of <codeph class="+ topic/ph pr-d/codeph ">doubleScaleMatrix</codeph>. It then demonstrates that
the two are Matrix inverses of one another -- matrices that undo any
transformations performed by the other -- by creating <codeph class="+ topic/ph pr-d/codeph ">originalAndInverseMatrix</codeph>
which is equal to <codeph class="+ topic/ph pr-d/codeph ">noScaleMatrix</codeph>.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.geom.Matrix;
import flash.geom.Transform;
public class Matrix_invert extends Sprite
{
public function Matrix_invert()
{
var rect0:Shape = createRectangle(20, 80, 0xFF0000);
var rect1:Shape = createRectangle(20, 80, 0x00FF00);
var rect2:Shape = createRectangle(20, 80, 0x0000FF);
var rect3:Shape = createRectangle(20, 80, 0x000000);
var trans0:Transform = new Transform(rect0);
var trans1:Transform = new Transform(rect1);
var trans2:Transform = new Transform(rect2);
var trans3:Transform = new Transform(rect3);
var doubleScaleMatrix:Matrix = new Matrix(2, 0, 0, 2, 0, 0);
trans0.matrix = doubleScaleMatrix;
trace(doubleScaleMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
var noScaleMatrix:Matrix = new Matrix(1, 0, 0, 1, 0, 0);
trans1.matrix = noScaleMatrix;
rect1.x = 50;
trace(noScaleMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
var halfScaleMatrix:Matrix = doubleScaleMatrix.clone();
halfScaleMatrix.invert();
trans2.matrix = halfScaleMatrix;
rect2.x = 100;
trace(halfScaleMatrix.toString()); // (a=0.5, b=0, c=0, d=0.5, tx=0, ty=0)
var originalAndInverseMatrix:Matrix = doubleScaleMatrix.clone();
originalAndInverseMatrix.concat(halfScaleMatrix);
trans3.matrix = originalAndInverseMatrix;
rect3.x = 150;
trace(originalAndInverseMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
}
public function createRectangle(w:Number, h:Number, color:Number):Shape
{
var rect:Shape = new Shape();
rect.graphics.beginFill(color);
rect.graphics.drawRect(0, 0, w, h);
addChild(rect);
return rect;
}
}
}
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:rotate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">rotate</apiName><shortdesc class="- topic/shortdesc ">
Applies a rotation transformation to the Matrix object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example the <code>rotate()</code> method rotates <code>rectangleMc</code>
30 degrees clockwise. Notice that applying <code>myMatrix</code> to <code>rectangleMc</code>
resets its <i class="+ topic/ph hi-d/i ">_x</i> value leaving us to reset it to 100 manually.
<listing version="2.0">
import flash.geom.Matrix;
import flash.geom.Transform;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
var degrees:Number = 30;
var radians:Number = (degrees/180) ~~ Math.PI;
myMatrix.rotate(radians);
trace(myMatrix.toString()); // (a=0.866025403784439, b=0.5, c=-0.5, d=0.866025403784439, tx=0, ty=0)
var rectangleMc:MovieClip = createRectangle(20, 80, 0xFF0000);
trace(rectangleMc._x); // 0
rectangleMc._x = 100;
trace(rectangleMc._x); // 100
var rectangleTrans:Transform = new Transform(rectangleMc);
rectangleTrans.matrix = myMatrix;
trace(rectangleMc._x); // 0
rectangleMc._x = 100;
trace(rectangleMc._x); // 100
function createRectangle(width:Number, height:Number, color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
The above example uses the <code>_x</code> property of the MovieClip object
to position <code>rectangleMc</code>. Generally, when dealing with Matrix
positioning, mixing positioning techniques is considered bad style. The
example above written in good style would concatenate a translation Matrix to
<code>myMatrix</code> to change the horizontal location of <code>rectangleMc</code>.
The following example demonstrates this.
<listing version="2.0">
import flash.geom.Matrix;
import flash.geom.Transform;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
var degrees:Number = 30;
var radians:Number = (degrees/180) ~~ Math.PI;
myMatrix.rotate(radians);
trace(myMatrix.toString()); // (a=0.866025403784439, b=0.5, c=-0.5, d=0.866025403784439, tx=0, ty=0)
var translateMatrix:Matrix = new Matrix();
translateMatrix.translate(100, 0);
myMatrix.concat(translateMatrix);
trace(myMatrix.toString()); // (a=0.866025403784439, b=0.5, c=-0.5, d=0.866025403784439, tx=100, ty=0)
var rectangleMc:MovieClip = createRectangle(20, 80, 0xFF0000);
trace(rectangleMc._x); // 0
rectangleMc._x = 100;
trace(rectangleMc._x); // 100
var rectangleTrans:Transform = new Transform(rectangleMc);
rectangleTrans.matrix = myMatrix;
trace(rectangleMc._x); // 100
function createRectangle(width:Number, height:Number, color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">angle</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The rotation angle in radians.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Applies a rotation transformation to the Matrix object.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">rotate()</codeph> method alters the <codeph class="+ topic/ph pr-d/codeph ">a</codeph>, <codeph class="+ topic/ph pr-d/codeph ">b</codeph>, <codeph class="+ topic/ph pr-d/codeph ">c</codeph>,
and <codeph class="+ topic/ph pr-d/codeph ">d</codeph> properties of the Matrix object.
In matrix notation, this is the same as concatenating the current matrix with the following:</p>
<p class="- topic/p "><adobeimage alt="Matrix notation of scale method parameters" height="105" href="../../images/matrix_rotate.jpg" width="219" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:scale" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">scale</apiName><shortdesc class="- topic/shortdesc ">
Applies a scaling transformation to the matrix.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example uses the <code>scale()</code> method to
scale <code>myMatrix</code> by a factor of 3 horizontally and a factor of 4
vertically.
<listing version="2.0">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix(2, 0, 0, 2, 100, 100);
trace(myMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=100, ty=100)
myMatrix.scale(3, 4);
trace(myMatrix.toString()); // (a=6, b=0, c=0, d=8, tx=300, ty=400)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">sx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the <i class="+ topic/ph hi-d/i ">x</i> axis.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">sy</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A multiplier used to scale the object along the <i class="+ topic/ph hi-d/i ">y</i> axis.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Applies a scaling transformation to the matrix. The <i class="+ topic/ph hi-d/i ">x</i> axis is multiplied
by <codeph class="+ topic/ph pr-d/codeph ">sx</codeph>, and the <i class="+ topic/ph hi-d/i ">y</i> axis it is multiplied by <codeph class="+ topic/ph pr-d/codeph ">sy</codeph>.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">scale()</codeph> method alters the <codeph class="+ topic/ph pr-d/codeph ">a</codeph> and <codeph class="+ topic/ph pr-d/codeph ">d</codeph> properties of
the Matrix object.
In matrix notation, this is the same as concatenating the current matrix with the following matrix:</p>
<p class="- topic/p "><adobeimage alt="Matrix notation of scale method parameters" height="105" href="../../images/matrix_scale.jpg" width="140" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
Returns a text value listing the properties of the Matrix object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates <code>myMatrix</code> and converts its values
to a String in the format of (a=A, b=B, c=C, d=D, tx=TX, ty=TY).
<listing version="2.0">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace("myMatrix: " + myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A string containing the values of the properties of the Matrix object: <codeph class="+ topic/ph pr-d/codeph ">a</codeph>, <codeph class="+ topic/ph pr-d/codeph ">b</codeph>, <codeph class="+ topic/ph pr-d/codeph ">c</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">d</codeph>, <codeph class="+ topic/ph pr-d/codeph ">tx</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">ty</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Returns a text value listing the properties of this Matrix object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a text value listing the properties of the Matrix object.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:transformPoint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">transformPoint</apiName><shortdesc class="- topic/shortdesc ">
Returns the result of applying the geometric transformation represented by the Matrix object to the
specified point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example uses the <code>transformPoint()</code> method
to create <code>transformedPoint</code> from <code>myPoint</code>. Notice that
the <code>translate()</code> method does have an affect on the position of <code>transformedPoint</code>.
In the example, <code>scale()</code> increases the original <code>x</code>
value by a factor of three from 50 to 150, and <code>translate()</code> increases
<code>x</code> by 300 for a total value of 450.
<listing version="2.0">
import flash.geom.Matrix;
import flash.geom.Point;
var myMatrix:Matrix = new Matrix();
trace(myMatrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.translate(100, 0);
trace(myMatrix); // (a=1, b=0, c=0, d=1, tx=100, ty=0)
myMatrix.scale(3, 3);
trace(myMatrix); // (a=3, b=0, c=0, d=3, tx=300, ty=0)
var myPoint:Point = new Point(50,0);
trace(myPoint); // (50, 0)
var transformedPoint:Point = myMatrix.transformPoint(myPoint);
trace(transformedPoint); // (450, 0)
var pointMc_0:MovieClip = createRectangle(10, 10, 0xFF0000);
pointMc_0._x = myPoint.x;
var pointMc_1:MovieClip = createRectangle(10, 10, 0x00FF00);
pointMc_1._x = transformedPoint.x;
function createRectangle(width:Number, height:Number, color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point resulting from applying the Matrix transformation.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">point</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point for which you want to get the result of the Matrix transformation.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Returns the result of a geometric transformation to a Point object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns the result of applying the geometric transformation represented by the Matrix object to the
specified point.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Matrix:translate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">translate</apiName><shortdesc class="- topic/shortdesc ">
Translates the matrix along the x and y axes, as specified by the dx
and dy parameters.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example uses the <code>translate()</code> method to position
<code>rectangleMc</code> x:100 and y:50. Notice that <code>translate()</code> affects
the translate values <code>tx</code> and <code>ty</code> but not <code>a</code>, <code>b</code>,
<code>c</code>, or <code>d</code>.
<listing version="2.0">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix(2, 0, 0, 2, 100, 100);
trace(myMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=100, ty=100)
myMatrix.translate(100, 50);
trace(myMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=200, ty=150)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The amount of movement along the <i class="+ topic/ph hi-d/i ">x</i> axis to the right, in pixels.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dy</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The amount of movement down along the <i class="+ topic/ph hi-d/i ">y</i> axis, in pixels.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Translates the matrix along the x and y axes.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">translate()</codeph> method alters the <codeph class="+ topic/ph pr-d/codeph ">tx</codeph> and <codeph class="+ topic/ph pr-d/codeph ">ty</codeph> properties of
the matrix object.
In matrix notation, this is the same as concatenating the current matrix with the following:</p>
<p class="- topic/p "><adobeimage alt="Matrix notation of scale method parameters" height="105" href="../../images/matrix_translate.jpg" width="150" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Translates the matrix along the <i class="+ topic/ph hi-d/i ">x</i> and <i class="+ topic/ph hi-d/i ">y</i> axes, as specified by the <codeph class="+ topic/ph pr-d/codeph ">dx</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">dy</codeph> parameters.
</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.geom:Matrix:a" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">a</apiName><shortdesc class="- topic/shortdesc ">
The value that affects the positioning of pixels
along the x axis when scaling or rotating an image.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The value that affects the positioning of pixels
along the x axis when scaling or rotating an image.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">x</i> axis when scaling or rotating an image.
</apiDesc><example conref="examples\Matrix.a.1.as" class="- topic/example "> The following example creates the Matrix object <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> and sets its
<codeph class="+ topic/ph pr-d/codeph ">a</codeph> value.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.a); // 1
myMatrix.a = 2;
trace(myMatrix.a); // 2
</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.geom:Matrix:b" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">b</apiName><shortdesc class="- topic/shortdesc ">
The value that affects the positioning of pixels
along the y axis when rotating or skewing an image.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The value that affects the positioning of pixels
along the y axis when rotating or skewing an image.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">y</i> axis when rotating or skewing an image.
</apiDesc><example conref="examples\Matrix.b.1.as" class="- topic/example "> The following example creates the Matrix object <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> and sets its
<codeph class="+ topic/ph pr-d/codeph ">b</codeph> value.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.b); // 0
var degrees:Number = 30;
var radians:Number = (degrees/180) ~~ Math.PI;
myMatrix.b = Math.tan(radians);
trace(myMatrix.b); // 0.5773502691896257
</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.geom:Matrix:c" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">c</apiName><shortdesc class="- topic/shortdesc ">
The value that affects the positioning of pixels
along the x axis when rotating or skewing an image.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The value that affects the positioning of pixels
along the x axis when rotating or skewing an image.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">x</i> axis when rotating or skewing an image.
</apiDesc><example conref="examples\Matrix.c.1.as" class="- topic/example "> The following example creates the Matrix object <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> and sets its
<codeph class="+ topic/ph pr-d/codeph ">c</codeph> value.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.c); // 0
var degrees:Number = 30;
var radians:Number = (degrees/180) ~~ Math.PI;
myMatrix.c = Math.tan(radians);
trace(myMatrix.c); // 0.5773502691896257
</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.geom:Matrix:d" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">d</apiName><shortdesc class="- topic/shortdesc ">
The value that affects the positioning of pixels
along the y axis when scaling or rotating an image.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The value that affects the positioning of pixels
along the y axis when scaling or rotating an image.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The value that affects the positioning of pixels
along the <i class="+ topic/ph hi-d/i ">y</i> axis when scaling or rotating an image.
</apiDesc><example conref="examples\Matrix.d.1.as" class="- topic/example "> The following example creates the Matrix object <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> and sets its
<codeph class="+ topic/ph pr-d/codeph ">d</codeph> value.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.d); // 1
myMatrix.d = 2;
trace(myMatrix.d); // 2
</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.geom:Matrix:tx" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">tx</apiName><shortdesc class="- topic/shortdesc ">
The distance by which to translate each point along the x axis.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The distance by which to translate each point along the x axis.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The distance by which to translate each point along the <i class="+ topic/ph hi-d/i ">x</i> axis.
</apiDesc><example conref="examples\Matrix.tx.1.as" class="- topic/example "> The following example creates the Matrix object <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> and sets its
<codeph class="+ topic/ph pr-d/codeph ">tx</codeph> value.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.tx); // 0
myMatrix.tx = 50; // 50
trace(myMatrix.tx);
</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.geom:Matrix:ty" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">ty</apiName><shortdesc class="- topic/shortdesc ">
The distance by which to translate each point along the y axis.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The distance by which to translate each point along the y axis.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The distance by which to translate each point along the <i class="+ topic/ph hi-d/i ">y</i> axis.
</apiDesc><example conref="examples\Matrix.ty.1.as" class="- topic/example "> The following example creates the Matrix object <codeph class="+ topic/ph pr-d/codeph ">myMatrix</codeph> and sets its
<codeph class="+ topic/ph pr-d/codeph ">ty</codeph> value.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.ty); // 0
myMatrix.ty = 50;
trace(myMatrix.ty); // 50
</codeblock></example></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:Rectangle" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Rectangle</apiName><shortdesc class="- topic/shortdesc ">
A Rectangle object is an area defined by its position, as
indicated by its top-left corner point (x, y) and by its width
and its height.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">A Rectangle object is an area defined by its position, as
indicated by its top-left corner point (x, y), and by its width
and its height.
</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A Rectangle object is an area defined by its position, as
indicated by its top-left corner point (<i class="+ topic/ph hi-d/i ">x</i>, <i class="+ topic/ph hi-d/i ">y</i>) and by its width
and its height.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, <codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and
<codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties of the Rectangle class are
independent of each other; changing the value of one property has
no effect on the others. However, the <codeph class="+ topic/ph pr-d/codeph ">right</codeph> and <codeph class="+ topic/ph pr-d/codeph ">bottom</codeph>
properties are integrally related to those four properties. For example, if you change
the value of the <codeph class="+ topic/ph pr-d/codeph ">right</codeph> property, the value of the <codeph class="+ topic/ph pr-d/codeph ">width</codeph> property
changes; if you change the <codeph class="+ topic/ph pr-d/codeph ">bottom</codeph> property, the value of the <codeph class="+ topic/ph pr-d/codeph ">height</codeph>
property changes. </p>
<p class="- topic/p ">The following methods and properties use Rectangle objects:</p>
<ul class="- topic/ul "><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">applyFilter()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">colorTransform()</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">copyChannel()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">copyPixels()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">draw()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">fillRect()</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">generateFilterRect()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">getColorBoundsRect()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">getPixels()</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">merge()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">paletteMap()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">pixelDisolve()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">setPixels()</codeph>, and
<codeph class="+ topic/ph pr-d/codeph ">threshold()</codeph> methods, and the <codeph class="+ topic/ph pr-d/codeph ">rect</codeph> property of the BitmapData class</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">getBounds()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">getRect()</codeph> methods, and the <codeph class="+ topic/ph pr-d/codeph ">scrollRect</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">scale9Grid</codeph> properties of the DisplayObject class</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">getCharBoundaries()</codeph> method of the TextField class</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">pixelBounds</codeph> property of the Transform class</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">bounds</codeph> parameter for the <codeph class="+ topic/ph pr-d/codeph ">startDrag()</codeph> method of the Sprite class</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">printArea</codeph> parameter of the <codeph class="+ topic/ph pr-d/codeph ">addPage()</codeph> method of the PrintJob class</li></ul>
<p class="- topic/p ">You can use the <codeph class="+ topic/ph pr-d/codeph ">new Rectangle()</codeph> constructor to create a
Rectangle object.</p>
<p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> The Rectangle class does not define a rectangular Shape display object. To draw
a rectangular Shape object onscreen, use the <codeph class="+ topic/ph pr-d/codeph ">drawRect()</codeph> method of the Graphics
class.</p>
</apiDesc><example conref="examples\RectangleExample.as" class="- topic/example "> The following example uses the RectangleExample class to create three new Rectangle
objects at various <i class="+ topic/ph hi-d/i ">x</i>,<i class="+ topic/ph hi-d/i ">y</i> coordinates and with various heights and widths and then uses the
<codeph class="+ topic/ph pr-d/codeph ">trace()</codeph> method to confirm that the Rectangle instances were successfully created. Then a Boolean
variable <codeph class="+ topic/ph pr-d/codeph ">isContained</codeph> is assigned to the result of the call to
the <codeph class="+ topic/ph pr-d/codeph ">containsRect()</codeph> method,
which determines that the second rectangle does not fully enclose the third rectangle.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.Sprite;
import flash.geom.Rectangle;
public class RectangleExample extends Sprite {
public function RectangleExample() {
var firstRect:Rectangle = new Rectangle();
trace(firstRect); // (x=0, y=0, w=0, h=0)
var secondRect:Rectangle = new Rectangle(1, 3, 11, 13);
trace(secondRect); // (x=1, y=3, w=11, h=13)
var thirdRect:Rectangle = new Rectangle(5, 8, 17, 19);
trace(thirdRect); // (x=5, y=8, w=17, h=19)
var isContained:Boolean = secondRect.containsRect(thirdRect);
trace(isContained); // false
}
}
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObject/scrollRect" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject.scrollRect</linktext></link><link href="flash.display.xml#BitmapData" class="- topic/link "><linktext class="- topic/linktext ">flash.display.BitmapData</linktext></link><link href="flash.display.xml#DisplayObject" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject</linktext></link><link href="flash.display.xml#NativeWindow" class="- topic/link "><linktext class="- topic/linktext ">flash.display.NativeWindow</linktext></link><link href="flash.text.xml#TextField/getCharBoundaries()" class="- topic/link "><linktext class="- topic/linktext ">flash.text.TextField.getCharBoundaries()</linktext></link><link href="flash.geom.xml#Transform/pixelBounds" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Transform.pixelBounds</linktext></link><link href="flash.display.xml#Sprite/startDrag()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Sprite.startDrag()</linktext></link><link href="flash.printing.xml#PrintJob/addPage()" class="- topic/link "><linktext class="- topic/linktext ">flash.printing.PrintJob.addPage()</linktext></link></related-links><apiConstructor id="flash.geom:Rectangle:Rectangle" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Rectangle</apiName><shortdesc class="- topic/shortdesc ">
Creates a new Rectangle object with the top-left corner specified by the x
and y parameters and with the specified width and height
parameters.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a new Rectangle with with specific parameters.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(5, 10, 50, 100);
trace(rect.toString()); // (x=5, y=10, w=50, h=100)
</listing>
</maelexample></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">x</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The <i class="+ topic/ph hi-d/i ">x</i> coordinate of the top-left corner of the rectangle.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">y</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The <i class="+ topic/ph hi-d/i ">y</i> coordinate of the top-left corner of the rectangle.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">width</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The width of the rectangle, in pixels.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">height</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The height of the rectangle, in pixels.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Creates a new Rectangle object with the top-left corner specified by the
x and y parameters and with the specified width and height.
</apiTipText></apiTipTexts></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates a new Rectangle object with the top-left corner specified by the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">y</codeph> parameters and with the specified <codeph class="+ topic/ph pr-d/codeph ">width</codeph> and <codeph class="+ topic/ph pr-d/codeph ">height</codeph>
parameters. If you call this function without parameters,
a rectangle with <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, <codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph>
properties set to 0 is created.
</apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiConstructor><apiOperation id="flash.geom:Rectangle:clone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">clone</apiName><shortdesc class="- topic/shortdesc ">
Returns a new Rectangle object with the same values for the x, y,
width, and height properties as the original Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example demonstrates the <code>clone</code> member.
<listing version="2.0">
import flash.geom.Rectangle;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
var shadow:Rectangle = rect.clone();
shadow.offset(5, 5);
trace(rect); // (x=1, y=2, w=4, h=8)
trace(shadow); // (x=6, y=7, w=4, h=8)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A new Rectangle object with the same values for the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties as the original Rectangle object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Returns a copy of this Rectangle object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a new Rectangle object with the same values for the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties as the original Rectangle object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:containsPoint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">containsPoint</apiName><shortdesc class="- topic/shortdesc ">
Determines whether the specified point is contained within the rectangular region defined
by this Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Do the specified Points fall inside of the Rectangle?
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(10, 10, 50, 50);
var containsPoint_1:Boolean = rect.containsPoint(new Point(10, 10));
trace(containsPoint_1); // true
var containsPoint_2:Boolean = rect.containsPoint(new Point(59, 59));
trace(containsPoint_2); // true
var containsPoint_3:Boolean = rect.containsPoint(new Point(60, 60));
trace(containsPoint_3); // false
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the Rectangle object contains the specified point;
otherwise <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">point</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point, as represented by its <i class="+ topic/ph hi-d/i ">x</i> and <i class="+ topic/ph hi-d/i ">y</i> coordinates.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Determines if the specified point is contained within the rectangular region defined
by this Rectangle object using a Point object as a parameter.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether the specified point is contained within the rectangular region defined
by this Rectangle object. This method is similar to the <codeph class="+ topic/ph pr-d/codeph ">Rectangle.contains()</codeph> method,
except that it takes a Point object as a parameter.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/contains()" class="- topic/link "><linktext class="- topic/linktext ">contains()</linktext></link><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:containsRect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">containsRect</apiName><shortdesc class="- topic/shortdesc ">
Determines whether the Rectangle object specified by the rect parameter is contained
within this Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>A Rectangle is said to contain another if that second
Rectangle falls entirely within the boundaries of the first.
<listing version="2.0">
import flash.geom.~~;
var rectA:Rectangle = new Rectangle(10, 10, 50, 50);
var rectB:Rectangle = new Rectangle(10, 10, 50, 50);
var rectC:Rectangle = new Rectangle(10, 10, 51, 51);
var rectD:Rectangle = new Rectangle(15, 15, 45, 45);
var rectAContainsB:Boolean = rectA.containsRect(rectB); // true
var rectAContainsC:Boolean = rectA.containsRect(rectC); // false
var rectAContainsD:Boolean = rectA.containsRect(rectD); // true
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the Rectangle object that you specify is
contained by this Rectangle object; otherwise <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">rect</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Rectangle object being checked.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Determines if the Rectangle object specified by the rect parameter is contained
within this Rectangle object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether the Rectangle object specified by the <codeph class="+ topic/ph pr-d/codeph ">rect</codeph> parameter is contained
within this Rectangle object. A Rectangle object is said to contain another if the second
Rectangle object falls entirely within the boundaries of the first.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Rectangle:contains" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">contains</apiName><shortdesc class="- topic/shortdesc ">
Determines whether the specified point is contained within the rectangular region defined
by this Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Do the coordinates fall inside of the Rectangle?
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(10, 10, 50, 50);
var doesContain_1:Boolean = rect.contains(59, 59);
trace(doesContain_1); // true
var doesContain_2:Boolean = rect.contains(10, 10);
trace(doesContain_2); // true
var doesContain_3:Boolean = rect.contains(60, 60);
trace(doesContain_3); // false
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the Rectangle object contains the specified point;
otherwise <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">x</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The <i class="+ topic/ph hi-d/i ">x</i> coordinate (horizontal position) of the point.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">y</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The <i class="+ topic/ph hi-d/i ">y</i> coordinate (vertical position) of the point.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Determines if the specified point is contained within the rectangular region.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether the specified point is contained within the rectangular region defined
by this Rectangle object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:equals" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">equals</apiName><shortdesc class="- topic/shortdesc ">
Determines whether the object specified in the toCompare parameter is
equal to this Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Even though the method signature only expects an abstract Object
only other Rectangle instances will ever be treated as equal.
<listing version="2.0">
import flash.geom.~~;
var rect_1:Rectangle = new Rectangle(0, 0, 50, 100);
var nonRect:Object = new Object();
nonRect.x = 0;
nonRect.y = 0;
nonRect.width = 50;
nonRect.height = 100;
trace(rect_1.equals(nonRect));
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the object has exactly the same values for the
<codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, <codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties
as this Rectangle object; otherwise <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toCompare</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The rectangle to compare to this Rectangle object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Determines if the object specified in the toCompare parameter is equal to this
Rectangle object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether the object specified in the <codeph class="+ topic/ph pr-d/codeph ">toCompare</codeph> parameter is
equal to this Rectangle object. This method compares the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties of an object against the same properties
of this Rectangle object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:inflatePoint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">inflatePoint</apiName><shortdesc class="- topic/shortdesc ">
Increases the size of the Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a Rectangle and inflate it by the <i class="+ topic/ph hi-d/i ">x</i> <i class="+ topic/ph hi-d/i ">horizontal</i> and <i class="+ topic/ph hi-d/i ">y</i> <i class="+ topic/ph hi-d/i ">vertical</i> amounts found in Point
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(0, 0, 2, 5);
var myPoint:Point = new Point(2, 2);
rect.inflatePoint(myPoint);
trace(rect.toString()); // (x=-2, y=-2, w=6, h=9)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">point</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The <codeph class="+ topic/ph pr-d/codeph ">x</codeph> property of this Point object is used to increase the
horizontal dimension of the Rectangle object. The <codeph class="+ topic/ph pr-d/codeph ">y</codeph> property
is used to increase the vertical dimension of the Rectangle object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Increases the size of the Rectangle object using a Point object as a parameter.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Increases the size of the Rectangle object.
This method is similar to the <codeph class="+ topic/ph pr-d/codeph ">Rectangle.inflate()</codeph> method
except it takes a Point object as a parameter.
<p class="- topic/p ">The following two code examples give the same result:</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var rect1:Rectangle = new Rectangle(0,0,2,5);
rect1.inflate(2,2)
</codeblock>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var rect1:Rectangle = new Rectangle(0,0,2,5);
var pt1:Point = new Point(2,2);
rect1.inflatePoint(pt1)
</codeblock>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:inflate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">inflate</apiName><shortdesc class="- topic/shortdesc ">
Increases the size of the Rectangle object by the specified amounts, in pixels.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a Rectangle and increase its <code>width</code> by 16 ~~ 2 (32) and it's <code>height</code> by 32 ~~ 2 (64)
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
trace(rect.toString()); // (x=1, y=2, w=4, h=8)
rect.inflate(16, 32);
trace(rect.toString()); // (x=-15, y=-30, w=36, h=72)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value to be added to the left and the right of the Rectangle object. The following
equation is used to calculate the new width and position of the rectangle:
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
x -= dx;
width += 2 ~~ dx;
</codeblock>
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dy</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value to be added to the top and the bottom of the Rectangle. The
following equation is used to calculate the new height and position of the rectangle:
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
y -= dy;
height += 2 ~~ dy;
</codeblock>
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Increases the size of the Rectangle object by the specified amounts, in pixels. The center point of the
Rectangle object stays the same, and its size increases to the left and right by the
<codeph class="+ topic/ph pr-d/codeph ">dx</codeph> value, and to the top and the bottom by the <codeph class="+ topic/ph pr-d/codeph ">dy</codeph> value.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:intersection" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">intersection</apiName><shortdesc class="- topic/shortdesc ">
If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle
object, returns the area of intersection as a Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>What area overlaps <code>rect_1</code> between <code>rect_2</code>?
<listing version="2.0">
import flash.geom.~~;
var rect_1:Rectangle = new Rectangle(0, 0, 50, 50);
var rect_2:Rectangle = new Rectangle(25, 25, 100, 100);
var intersectingArea:Rectangle = rect_1.intersection(rect_2);
trace(intersectingArea.toString()); // (x=25, y=25, w=25, h=25)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Rectangle object that equals the area of intersection. If the rectangles do not
intersect, this method returns an empty Rectangle object; that is, a rectangle with its <codeph class="+ topic/ph pr-d/codeph ">x</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">y</codeph>, <codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties set to 0.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toIntersect</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Rectangle object to compare against to see if it intersects with
this Rectangle object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Returns the area of intersection.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
If the Rectangle object specified in the <codeph class="+ topic/ph pr-d/codeph ">toIntersect</codeph> parameter intersects with this Rectangle
object, returns the area of intersection as a Rectangle object.
If the rectangles do not intersect, this method returns an empty Rectangle object with its properties
set to 0.
<p class="- topic/p "><adobeimage alt="The resulting intersection rectangle." href="../../images/rectangle_intersect.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Rectangle:intersects" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">intersects</apiName><shortdesc class="- topic/shortdesc ">
Determines whether the object specified in the toIntersect parameter intersects
with this Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Does <code>rect_1</code> intersect with <code>rect_2</code>?
<listing version="2.0">
import flash.geom.~~;
var rectA:Rectangle = new Rectangle(10, 10, 50, 50);
var rectB:Rectangle = new Rectangle(59, 59, 50, 50);
var rectC:Rectangle = new Rectangle(60, 60, 50, 50);
var rectAIntersectsB:Boolean = rectA.intersects(rectB);
var rectAIntersectsC:Boolean = rectA.intersects(rectC);
trace(rectAIntersectsB); // true
trace(rectAIntersectsC); // false
var firstPixel:Rectangle = new Rectangle(0, 0, 1, 1);
var adjacentPixel:Rectangle = new Rectangle(1, 1, 1, 1);
var pixelsIntersect:Boolean = firstPixel.intersects(adjacentPixel);
trace(pixelsIntersect); // false
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the specified object intersects with this Rectangle object;
otherwise <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toIntersect</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Rectangle object to compare against this Rectangle object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Determines if the object specified in the toIntersect parameter intersects
with this Rectangle object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether the object specified in the <codeph class="+ topic/ph pr-d/codeph ">toIntersect</codeph> parameter intersects
with this Rectangle object. This method checks the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties of the specified Rectangle object to see
if it intersects with this Rectangle object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:isEmpty" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">isEmpty</apiName><shortdesc class="- topic/shortdesc ">
Determines whether or not this Rectangle object is empty.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a non-empty Rectangle and make it become empty.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
trace(rect.isEmpty()); // false
rect.width = 0;
trace(rect.isEmpty()); // true
rect.width = 4;
trace(rect.isEmpty()); // false
rect.height = 0;
trace(rect.isEmpty()); // true
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the Rectangle object's width or height is less than
or equal to 0; otherwise <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether or not this Rectangle object is empty.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Rectangle:offsetPoint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">offsetPoint</apiName><shortdesc class="- topic/shortdesc ">
Adjusts the location of the Rectangle object using a Point object as a parameter.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Offset a Rectangle by using the values found in a Point
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
var myPoint:Point = new Point(16, 32);
rect.offsetPoint(myPoint);
trace(rect.toString()); // (x=17, y=34, w=4, h=8)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">point</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Point object to use to offset this Rectangle object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Adjusts the location of the Rectangle object using a Point object as a parameter.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Adjusts the location of the Rectangle object using a Point object as a parameter.
This method is similar to the <codeph class="+ topic/ph pr-d/codeph ">Rectangle.offset()</codeph> method, except that it takes a Point
object as a parameter.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:offset" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">offset</apiName><shortdesc class="- topic/shortdesc ">
Adjusts the location of the Rectangle object, as determined by its top-left corner,
by the specified amounts.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a Rectangle and offset it's <i class="+ topic/ph hi-d/i ">x</i> and <i class="+ topic/ph hi-d/i ">y</i> values by 5 and 10 respectively
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
rect.offset(16, 32);
trace(rect.toString()); // (x=17, y=34, w=4, h=8)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Moves the <i class="+ topic/ph hi-d/i ">x</i> value of the Rectangle object by this amount.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dy</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Moves the <i class="+ topic/ph hi-d/i ">y</i> value of the Rectangle object by this amount.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Adjusts the location of the Rectangle object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Adjusts the location of the Rectangle object, as determined by its top-left corner,
by the specified amounts.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Rectangle:setEmpty" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setEmpty</apiName><shortdesc class="- topic/shortdesc ">
Sets all of the Rectangle object's properties to 0.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a non-empty Rectangle and make it empty.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(5, 10, 50, 100);
trace(rect.isEmpty()); // false
rect.setEmpty();
trace(rect.isEmpty()); // true
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Sets all properties to 0.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or
height is less than or equal to 0.
<p class="- topic/p "> This method sets the values of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties to 0.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
Builds and returns a string that lists the horizontal and vertical positions
and the width and height of the Rectangle object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Concatenate a String representation of <code>rect_1</code> with some helpful
debugging text.
<listing version="2.0">
import flash.geom.~~;
var rect_1:Rectangle = new Rectangle(0, 0, 50, 100);
trace("Rectangle 1 : " + rect_1.toString()); // Rectangle 1 : (x=0, y=0, w=50, h=100)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A string listing the value of each of the following properties of the Rectangle object:
<codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, <codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph>.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Builds and returns a string that lists the horizontal and vertical positions
and the width and height of the Rectangle object.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Rectangle:union" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">union</apiName><shortdesc class="- topic/shortdesc ">
Adds two rectangles together to create a new Rectangle object, by
filling in the horizontal and vertical space between the two rectangles.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a new Rectangle out of the Union of two others.
<p class="- topic/p ">For example, consider a rectangle with properties <code>x=20</code>, <code>y=50</code>, <code>width=60</code>, and
<code>height=30</code> (20, 50, 60, 30) and a second rectangle with properties (150, 130, 50, 30).
The union of these two rectangles would be a larger rectangle encompassing the two rectangles
with the properties (20, 50, 180, 110).</p>
<listing version="2.0">
import flash.geom.~~;
var rect_1:Rectangle = new Rectangle(20, 50, 60, 30);
var rect_2:Rectangle = new Rectangle(150, 130, 50, 30);
var combined:Rectangle = rect_1.union(rect_2);
trace(combined.toString()); // (x=20, y=50, w=180, h=110)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A new Rectangle object that is the union of the two rectangles.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toUnion</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Rectangle</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A Rectangle object to add to this Rectangle object.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Adds two rectangles together to create a new Rectangle object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Adds two rectangles together to create a new Rectangle object, by
filling in the horizontal and vertical space between the two rectangles.
<p class="- topic/p "><adobeimage alt="The resulting union rectangle." href="../../images/rectangle_union.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> The <codeph class="+ topic/ph pr-d/codeph ">union()</codeph> method ignores rectangles with <codeph class="+ topic/ph pr-d/codeph ">0</codeph>
as the height or width value, such as: <codeph class="+ topic/ph pr-d/codeph ">var rect2:Rectangle = new Rectangle(300,300,50,0);</codeph></p>
</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.geom:Rectangle:height" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">height</apiName><shortdesc class="- topic/shortdesc ">
The height of the rectangle, in pixels.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a Rectangle and change its <i class="+ topic/ph hi-d/i ">width</i> property
from 10 to 20. Notice that <code>rect.right</code> is also
changed.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(5, 5, 10, 10);
trace(rect.width); // 10
trace(rect.right); // 15
rect.width = 20;
trace(rect.width); // 20
trace(rect.right); // 25
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The height of the rectangle in pixels.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The height of the rectangle, in pixels. Changing the <codeph class="+ topic/ph pr-d/codeph ">height</codeph> value of a Rectangle
object has no effect on the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, and
<codeph class="+ topic/ph pr-d/codeph ">width</codeph> properties.
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:width" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">width</apiName><shortdesc class="- topic/shortdesc ">
The width of the rectangle, in pixels.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a Rectangle object and change its <code>width</code> property
from 10 to 20. Notice that <code>rect.right</code> also
changes.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(5, 5, 10, 10);
trace(rect.width); // 10
trace(rect.right); // 15
rect.width = 20;
trace(rect.width); // 20
trace(rect.right); // 25
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The width of the rectangle.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The width of the rectangle, in pixels. Changing the <codeph class="+ topic/ph pr-d/codeph ">width</codeph> value of a Rectangle object
has no effect on the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">y</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph>
properties.
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:x" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">x</apiName><shortdesc class="- topic/shortdesc ">
The x coordinate of the top-left corner of the rectangle.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates an empty Rectangle and sets its <i class="+ topic/ph hi-d/i ">x</i> property
to 10. Notice that <code>rect.left</code> is also changed.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle();
trace(rect.x); // 0
trace(rect.left); // 0
rect.x = 10;
trace(rect.x); // 10
trace(rect.left); // 10
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The x coordinate of the top-left corner of the rectangle.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The <i class="+ topic/ph hi-d/i ">x</i> coordinate of the top-left corner of the rectangle. Changing
the value of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph> property of a Rectangle object has no effect on the
<codeph class="+ topic/ph pr-d/codeph ">y</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties.
<p class="- topic/p ">The value of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph> property is equal to the value of the
<codeph class="+ topic/ph pr-d/codeph ">left</codeph> property.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/left" class="- topic/link "><linktext class="- topic/linktext ">left</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:y" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">y</apiName><shortdesc class="- topic/shortdesc ">
The y coordinate of the top-left corner of the rectangle.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates an empty Rectangle and sets its <i class="+ topic/ph hi-d/i ">y</i> property
to 10. Notice that <code>rect.top</code> is also changed.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle();
trace(rect.y); // 0
trace(rect.top); // 0
rect.y = 10;
trace(rect.y); // 10
trace(rect.top); // 10
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The y coordinate of the top-left corner.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The <i class="+ topic/ph hi-d/i ">y</i> coordinate of the top-left corner of the rectangle. Changing
the value of the <codeph class="+ topic/ph pr-d/codeph ">y</codeph> property of a Rectangle object has no effect on the
<codeph class="+ topic/ph pr-d/codeph ">x</codeph>, <codeph class="+ topic/ph pr-d/codeph ">width</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties.
<p class="- topic/p ">The value of the <codeph class="+ topic/ph pr-d/codeph ">y</codeph> property is equal to the value of
the <codeph class="+ topic/ph pr-d/codeph ">top</codeph> property.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link><link href="flash.geom.xml#Rectangle/top" class="- topic/link "><linktext class="- topic/linktext ">top</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:bottomRight:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bottomRight</apiName><shortdesc class="- topic/shortdesc ">
The location of the Rectangle object's bottom-right corner, determined by the values of the right and
bottom properties.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Get the Rectangle <code>bottomRight</code> property as a Point object.
<listing version="2.0">
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
trace(rect.bottom); // 5
trace(rect.right); // 10
var myBottomRight:Point = rect.bottomRight;
trace(myBottomRight.x); // 5
trace(myBottomRight.y); // 10
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Point</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The location of the Rectangle object's bottom-right corner determined by the right
and bottom properties.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The location of the Rectangle object's bottom-right corner, determined by the values of the <codeph class="+ topic/ph pr-d/codeph ">right</codeph> and
<codeph class="+ topic/ph pr-d/codeph ">bottom</codeph> properties.
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:bottom:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bottom</apiName><shortdesc class="- topic/shortdesc ">
The sum of the y and
height properties.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a Rectangle and change its <i class="+ topic/ph hi-d/i ">bottom</i> property
from 15 to 30. Notice that <code>rect.height</code> is also
changed.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(5, 5, 10, 10);
trace(rect.height); // 10
trace(rect.bottom); // 15
rect.bottom = 30;
trace(rect.height); // 25
trace(rect.bottom); // 30
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The sum of the y and height properties.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The sum of the <codeph class="+ topic/ph pr-d/codeph ">y</codeph> and
<codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties.
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:left:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">left</apiName><shortdesc class="- topic/shortdesc ">
The x coordinate of the top-left corner of the rectangle.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Change the <i class="+ topic/ph hi-d/i ">left</i> property and notice that
<code>rect.x</code> is also changed.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle();
trace(rect.left); // 0
trace(rect.x); // 0
rect.left = 10;
trace(rect.left); // 10
trace(rect.x); // 10
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The x coordinate of the top-left corner of the rectangle.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The <i class="+ topic/ph hi-d/i ">x</i> coordinate of the top-left corner of the rectangle. Changing
the <codeph class="+ topic/ph pr-d/codeph ">left</codeph> property of a Rectangle object has no effect on the <codeph class="+ topic/ph pr-d/codeph ">y</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties. However it does affect the <codeph class="+ topic/ph pr-d/codeph ">width</codeph>
property, whereas changing the <codeph class="+ topic/ph pr-d/codeph ">x</codeph> value does <i class="+ topic/ph hi-d/i ">not</i> affect the
<codeph class="+ topic/ph pr-d/codeph ">width</codeph> property.
<p class="- topic/p ">The value of the <codeph class="+ topic/ph pr-d/codeph ">left</codeph> property is equal to the value of the
<codeph class="+ topic/ph pr-d/codeph ">x</codeph> property.</p>
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:right:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">right</apiName><shortdesc class="- topic/shortdesc ">
The sum of the x and
width properties.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Create a Rectangle and change its <i class="+ topic/ph hi-d/i ">right</i> property
from 15 to 30. Notice that <code>rect.width</code> is also
changed.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle(5, 5, 10, 10);
trace(rect.width); // 10
trace(rect.right); // 15
rect.right = 30;
trace(rect.width); // 25
trace(rect.right); // 30
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The sum of the x and width properties.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The sum of the <codeph class="+ topic/ph pr-d/codeph ">x</codeph> and
<codeph class="+ topic/ph pr-d/codeph ">width</codeph> properties.
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:size:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">size</apiName><shortdesc class="- topic/shortdesc ">
The size of the Rectangle object, expressed as a Point object with the values
of the width and height properties.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a new Rectangle, retrieves it's <code>size</code>,
changes the <code>size</code> and sets the new values on the Rectangle instance.
It is critical to remember that the <code>Point</code> object used by <code>size</code>
uses x and y values to represent the <code>width</code> and <code>height</code> properties
of the Rectangle.
<listing version="2.0">
import flash.geom.Rectangle;
import flash.geom.Point;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
var size:Point = rect.size;
trace(size.x); // 4;
trace(size.y); // 8;
size.x = 16;
size.y = 32;
rect.size = size;
trace(rect.x); // 1
trace(rect.y); // 2
trace(rect.width); // 16
trace(rect.height); // 32
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Point</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The size of the Rectangle object, expressed as a Point object with values
width, height.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The size of the Rectangle object, expressed as a Point object with the values
of the <codeph class="+ topic/ph pr-d/codeph ">width</codeph> and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> properties.
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:topLeft:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">topLeft</apiName><shortdesc class="- topic/shortdesc ">
The location of the Rectangle object's top-left corner, determined by the x and
y coordinates of the point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Get the Rectangle <code>topLeft</code> property as a Point object.
<listing version="2.0">
var rect:Rectangle = new Rectangle(5, 15);
var myTopLeft:Point = rect.topLeft;
trace(myTopLeft.x); // 5;
trace(myTopLeft.y); // 15;
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Point</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The location of the Rectangle object's top-left corner determined by the x and
y values of the point.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The location of the Rectangle object's top-left corner, determined by the <i class="+ topic/ph hi-d/i ">x</i> and
<i class="+ topic/ph hi-d/i ">y</i> coordinates of the point.
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Point</linktext></link><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link></related-links></apiValue><apiValue id="flash.geom:Rectangle:top:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">top</apiName><shortdesc class="- topic/shortdesc ">
The y coordinate of the top-left corner of the rectangle.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>Change the <i class="+ topic/ph hi-d/i ">top</i> property and notice that
<code>rect.y</code> is also changed.
<listing version="2.0">
import flash.geom.~~;
var rect:Rectangle = new Rectangle();
trace(rect.top); // 0
trace(rect.y); // 0
rect.top = 10;
trace(rect.top); // 10
trace(rect.y); // 10
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The y coordinate of the top-left corner of the rectangle.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The <i class="+ topic/ph hi-d/i ">y</i> coordinate of the top-left corner of the rectangle. Changing
the <codeph class="+ topic/ph pr-d/codeph ">top</codeph> property of a Rectangle object has no effect on the <codeph class="+ topic/ph pr-d/codeph ">x</codeph>
and <codeph class="+ topic/ph pr-d/codeph ">width</codeph> properties. However it does affect the <codeph class="+ topic/ph pr-d/codeph ">height</codeph>
property, whereas changing the <codeph class="+ topic/ph pr-d/codeph ">y</codeph> value does <i class="+ topic/ph hi-d/i ">not</i> affect the
<codeph class="+ topic/ph pr-d/codeph ">height</codeph> property.
<p class="- topic/p ">The value of the <codeph class="+ topic/ph pr-d/codeph ">top</codeph> property is equal to the value of the <codeph class="+ topic/ph pr-d/codeph ">y</codeph> property.</p>
<p class="- topic/p "><adobeimage alt="A rectangle image showing location and measurement properties." href="../../images/rectangle.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Rectangle/x" class="- topic/link "><linktext class="- topic/linktext ">x</linktext></link><link href="flash.geom.xml#Rectangle/y" class="- topic/link "><linktext class="- topic/linktext ">y</linktext></link><link href="flash.geom.xml#Rectangle/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.geom.xml#Rectangle/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:ColorTransform" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">ColorTransform</apiName><shortdesc class="- topic/shortdesc ">
The ColorTransform class lets you adjust the color values in a display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The ColorTransform class lets you adjust the color values in a display object.
The color adjustment or <i class="+ topic/ph hi-d/i ">color transformation</i> can be applied to all four channels:
red, green, blue, and alpha transparency.
<p class="- topic/p ">When a ColorTransform object is applied to a display object, a new value for each color
channel is calculated like this:</p>
<ul class="- topic/ul "><li class="- topic/li ">New red value = (old red value * <codeph class="+ topic/ph pr-d/codeph ">redMultiplier</codeph>) + <codeph class="+ topic/ph pr-d/codeph ">redOffset</codeph></li><li class="- topic/li ">New green value = (old green value * <codeph class="+ topic/ph pr-d/codeph ">greenMultiplier</codeph>) +
<codeph class="+ topic/ph pr-d/codeph ">greenOffset</codeph></li><li class="- topic/li ">New blue value = (old blue value * <codeph class="+ topic/ph pr-d/codeph ">blueMultiplier</codeph>) + <codeph class="+ topic/ph pr-d/codeph ">blueOffset</codeph></li><li class="- topic/li ">New alpha value = (old alpha value * <codeph class="+ topic/ph pr-d/codeph ">alphaMultiplier</codeph>) +
<codeph class="+ topic/ph pr-d/codeph ">alphaOffset</codeph></li></ul>
<p class="- topic/p ">If any of the color channel values is greater than 255 after the calculation, it is set to 255.
If it is less than 0, it is set to 0.</p>
<p class="- topic/p ">You can use ColorTransform objects in the following ways:</p>
<ul class="- topic/ul "><li class="- topic/li ">In the <codeph class="+ topic/ph pr-d/codeph ">colorTransform</codeph> parameter of the <codeph class="+ topic/ph pr-d/codeph ">colorTransform()</codeph> method
of the BitmapData class</li><li class="- topic/li ">As the <codeph class="+ topic/ph pr-d/codeph ">colorTransform</codeph> property of a Transform object (which can be
used as the <codeph class="+ topic/ph pr-d/codeph ">transform</codeph> property of a display object)</li></ul>
<p class="- topic/p ">You must use the <codeph class="+ topic/ph pr-d/codeph ">new ColorTransform()</codeph> constructor to create a
ColorTransform object before you can call the methods of the
ColorTransform object.</p>
<p class="- topic/p ">Color transformations do not apply to the background color of a movie clip (such as a loaded SWF
object). They apply only to graphics and symbols that are attached to the movie clip.</p>
</apiDesc><example conref="examples\ColorTransformExample.as" class="- topic/example "> The following example uses the TransformExample class to create a simple sprite
in the shape of a square filled with a gradient pattern. Each time the user clicks the square, the
application transforms the colors of the square sprite, adding to the red color channel and
lightening the blue color channel. This is accomplished with the following steps:
<ol class="- topic/ol "><li class="- topic/li ">The constructor creates a new sprite object <codeph class="+ topic/ph pr-d/codeph ">target</codeph>.</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">CustomButton()</codeph> constructor calls the <codeph class="+ topic/ph pr-d/codeph ">draw()</codeph> method, which draws a gradient
square in the sprite.</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">CustomButton()</codeph> constructor adds a click event listener for the sprite, which is handled by the
<codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method. </li><li class="- topic/li ">In the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method, two properties are set to the
<codeph class="+ topic/ph pr-d/codeph ">redOffset</codeph> and <codeph class="+ topic/ph pr-d/codeph ">blueOffset</codeph> properties of the current
color transformation. Each is adjusted by 25. Then the <codeph class="+ topic/ph pr-d/codeph ">transform.colorTransform</codeph>
property of the square sprite is modified to use the new offset values.
Each time the user clicks the square, the call to the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method modifies
the color of the square, by augmenting its red color value and diminishing its blue color value. </li></ol>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.Sprite;
import flash.display.GradientType;
import flash.geom.ColorTransform;
import flash.events.MouseEvent;
public class ColorTransformExample extends Sprite {
public function ColorTransformExample() {
var target:Sprite = new Sprite();
draw(target);
addChild(target);
target.useHandCursor = true;
target.buttonMode = true;
target.addEventListener(MouseEvent.CLICK, clickHandler)
}
public function draw(sprite:Sprite):void {
var red:uint = 0xFF0000;
var green:uint = 0x00FF00;
var blue:uint = 0x0000FF;
var size:Number = 100;
sprite.graphics.beginGradientFill(GradientType.LINEAR, [red, blue, green], [1, 0.5, 1], [0, 200, 255]);
sprite.graphics.drawRect(0, 0, 100, 100);
}
public function clickHandler(event:MouseEvent):void {
var rOffset:Number = transform.colorTransform.redOffset + 25;
var bOffset:Number = transform.colorTransform.redOffset - 25;
this.transform.colorTransform = new ColorTransform(1, 1, 1, 1, rOffset, 0, bOffset, 0);
}
}
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Transform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Transform</linktext></link><link href="flash.display.xml#DisplayObject/transform" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject.transform</linktext></link><link href="flash.display.xml#BitmapData/colorTransform()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.BitmapData.colorTransform()</linktext></link></related-links><apiConstructor id="flash.geom:ColorTransform:ColorTransform" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">ColorTransform</apiName><shortdesc class="- topic/shortdesc ">
Creates a ColorTransform object for a display object with the specified
color channel values and alpha values.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">new ColorTransform, constructor
</keyword></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">redMultiplier</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1.0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value for the red multiplier, in the range from 0 to 1.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">greenMultiplier</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1.0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value for the green multiplier, in the range from 0 to 1.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">blueMultiplier</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1.0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value for the blue multiplier, in the range from 0 to 1.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">alphaMultiplier</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1.0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The value for the alpha transparency multiplier, in the range from 0 to 1.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">redOffset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The offset value for the red color channel, in the range from -255 to 255.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">greenOffset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The offset value for the green color channel, in the range from -255 to 255.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">blueOffset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The offset for the blue color channel value, in the range from -255 to 255.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">alphaOffset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The offset for alpha transparency channel value, in the range from -255 to 255.
</apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Creates a ColorTransform object for a display object.
</apiTipText></apiTipTexts></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates a ColorTransform object for a display object with the specified
color channel values and alpha values.
</apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.geom:ColorTransform:concat" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">concat</apiName><shortdesc class="- topic/shortdesc ">
Concatenates the ColorTranform object specified by the second parameter
with the current ColorTransform object and sets the
current object as the result, which is an additive combination of the two color transformations.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example concatenates the ColorTransform object <code>colorTrans_2</code>
to <code>colorTrans_1</code> resulting in a full red offset combined with a .5 alpha multiplier.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans_1:ColorTransform = new ColorTransform(1, 1, 1, 1, 255, 0, 0, 0);
trace(colorTrans_1); // (redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=255, greenOffset=0, blueOffset=0, alphaOffset=0)
var colorTrans_2:ColorTransform = new ColorTransform(1, 1, 1, .5, 0, 0, 0, 0);
trace(colorTrans_2); // (redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=0.5, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
colorTrans_1.concat(colorTrans_2);
trace(colorTrans_1); // (redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=0.5, redOffset=255, greenOffset=0, blueOffset=0, alphaOffset=0)
var rect:MovieClip = createRectangle(20, 80, 0x000000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans_1;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">second</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:ColorTransform</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The ColorTransform object to be combined with the current ColorTransform object.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Concatenates the ColorTranform object specified by the <codeph class="+ topic/ph pr-d/codeph ">second</codeph> parameter
with the current ColorTransform object and sets the
current object as the result, which is an additive combination of the two color transformations.
When you apply the concatenated ColorTransform object, the effect is the same as applying the
<codeph class="+ topic/ph pr-d/codeph ">second</codeph> color transformation after the <i class="+ topic/ph hi-d/i ">original</i> color transformation.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:ColorTransform:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
Formats and returns a string that describes all of the properties of the
ColorTransform object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and calls its <code>toSting()</code> method. This method results in a string with the format
(redMultiplier=RM, greenMultiplier=GM, blueMultiplier=BM, alphaMultiplier=AM, redOffset=RO, greenOffset=GO, blueOffset=BO, alphaOffset=AO).
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform(1, 2, 3, 4, -255, -128, 128, 255);
trace(colorTrans.toString()); // (redMultiplier=1, greenMultiplier=2, blueMultiplier=3, alphaMultiplier=4, redOffset=-255, greenOffset=-128, blueOffset=128, alphaOffset=255)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A string that lists all of the properties of the ColorTransform object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Formats and returns a string that describes all of the properties of the
ColorTransform object.
</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.geom:ColorTransform:alphaMultiplier" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">alphaMultiplier</apiName><shortdesc class="- topic/shortdesc ">
A decimal value that is multiplied with the alpha transparency channel value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>alphaMultiplier</code> from 1 to .5.
<listing version="2.0">
import flash.geom.ColorTransform;
import flash.geom.Transform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.alphaMultiplier); // 1
colorTrans.alphaMultiplier = .5;
trace(colorTrans.alphaMultiplier); // .5
var rect:MovieClip = createRectangle(20, 80, 0x000000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A decimal value that is multiplied with the alpha transparency channel value.
<p class="- topic/p ">If you set the alpha transparency value of a display object directly by using the
<codeph class="+ topic/ph pr-d/codeph ">alpha</codeph> property of the DisplayObject instance, it affects the value of the
<codeph class="+ topic/ph pr-d/codeph ">alphaMultiplier</codeph> property of that display object's <codeph class="+ topic/ph pr-d/codeph ">transform.colorTransform</codeph>
property.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObject/alpha" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject.alpha</linktext></link></related-links></apiValue><apiValue id="flash.geom:ColorTransform:alphaOffset" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">alphaOffset</apiName><shortdesc class="- topic/shortdesc ">
A number from -255 to 255 that is added to the alpha transparency channel value after it has
been multiplied by the alphaMultiplier value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>alphaOffset</code> from 0 to -128.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.alphaOffset); // 0
colorTrans.alphaOffset = -128;
trace(colorTrans.alphaOffset); // -128
var rect:MovieClip = createRectangle(20, 80, 0x000000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">A number from -255 to 255 that is added to the alpha transparency channel value after it has been
multiplied by the alphaMultiplier value.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A number from -255 to 255 that is added to the alpha transparency channel value after it has
been multiplied by the <codeph class="+ topic/ph pr-d/codeph ">alphaMultiplier</codeph> value.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:ColorTransform:blueMultiplier" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">blueMultiplier</apiName><shortdesc class="- topic/shortdesc ">
A decimal value that is multiplied with the blue channel value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>blueMultiplier</code> from 1 to .5.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.blueMultiplier); // 1
colorTrans.blueMultiplier = .5;
trace(colorTrans.blueMultiplier); // .5
var rect:MovieClip = createRectangle(20, 80, 0x0000FF);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A decimal value that is multiplied with the blue channel value.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:ColorTransform:blueOffset" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">blueOffset</apiName><shortdesc class="- topic/shortdesc ">
A number from -255 to 255 that is added to the blue channel value after it has
been multiplied by the blueMultiplier value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>blueOffset</code> from 0 to 255.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.blueOffset); // 0
colorTrans.blueOffset = 255;
trace(colorTrans.blueOffset); // 255
var rect:MovieClip = createRectangle(20, 80, 0x000000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">A number from -255 to 255 that is added to the blue channel value after it has
been multiplied by the blueMultiplier value.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A number from -255 to 255 that is added to the blue channel value after it has
been multiplied by the <codeph class="+ topic/ph pr-d/codeph ">blueMultiplier</codeph> value.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:ColorTransform:greenMultiplier" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">greenMultiplier</apiName><shortdesc class="- topic/shortdesc ">
A decimal value that is multiplied with the green channel value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>greenMultiplier</code> from 1 to .5.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.greenMultiplier); // 1
colorTrans.greenMultiplier = .5;
trace(colorTrans.greenMultiplier); // .5
var rect:MovieClip = createRectangle(20, 80, 0x00FF00);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A decimal value that is multiplied with the green channel value.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:ColorTransform:greenOffset" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">greenOffset</apiName><shortdesc class="- topic/shortdesc ">
A number from -255 to 255 that is added to the green channel value after it has
been multiplied by the greenMultiplier value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>greenOffset</code> from 0 to 255.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.greenOffset); // 0
colorTrans.redOffset = 255;
trace(colorTrans.greenOffset); // 255
var rect:MovieClip = createRectangle(20, 80, 0x000000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">A number from -255 to 255 that is added to the green channel value after it has
been multiplied by the greenMultiplier value.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A number from -255 to 255 that is added to the green channel value after it has
been multiplied by the <codeph class="+ topic/ph pr-d/codeph ">greenMultiplier</codeph> value.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:ColorTransform:redMultiplier" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">redMultiplier</apiName><shortdesc class="- topic/shortdesc ">
A decimal value that is multiplied with the red channel value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>redMultiplier</code> from 1 to .5.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.redMultiplier); // 1
colorTrans.redMultiplier = .5;
trace(colorTrans.redMultiplier); // .5
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A decimal value that is multiplied with the red channel value.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:ColorTransform:redOffset" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">redOffset</apiName><shortdesc class="- topic/shortdesc ">
A number from -255 to 255 that is added to the red channel value after it has been
multiplied by the redMultiplier value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates the ColorTransform object <code>colorTrans</code>
and adjusts its <code>redOffset</code> from 0 to 255.
<listing version="2.0">
import flash.geom.ColorTransform;
var colorTrans:ColorTransform = new ColorTransform();
trace(colorTrans.redOffset); // 0
colorTrans.redOffset = 255;
trace(colorTrans.redOffset); // 255
var rect:MovieClip = createRectangle(20, 80, 0x000000);
var trans:Transform = new Transform(rect);
trans.colorTransform = colorTrans;
function createRectangle(width:Number, height:Number, color:Number, scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">A number from -255 to 255 that is added to the red channel value after it
has been multiplied by the redMultiplier value.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A number from -255 to 255 that is added to the red channel value after it has been
multiplied by the <codeph class="+ topic/ph pr-d/codeph ">redMultiplier</codeph> value.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:ColorTransform:color:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">color</apiName><shortdesc class="- topic/shortdesc ">
The RGB color value for a ColorTransform object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><oldexample>This example sets the RGB color value for the movie clip <code>my_mc</code>.<span class="flashonly"> To see this code work, place a movie clip on the Stage with the instance name <code>my_mc</code>. Then place the following code on Frame 1 in the main Timeline and select Control &gt; Test Movie:</span>
<pre xml:space="preserve" class="- topic/pre ">
<code>var my_color:Color = new Color(my_mc);</code>
<code>my_color.setRGB(0xFF0000); // my_mc turns red</code>
</pre>
</oldexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The RGB color value for a ColorTransform object.
<p class="- topic/p ">When you set this property, it changes the three color offset values (<codeph class="+ topic/ph pr-d/codeph ">redOffset</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">greenOffset</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">blueOffset</codeph>)
accordingly, and it sets the three color multiplier values (<codeph class="+ topic/ph pr-d/codeph ">redMultiplier</codeph>,
<codeph class="+ topic/ph pr-d/codeph ">greenMultiplier</codeph>, and <codeph class="+ topic/ph pr-d/codeph ">blueMultiplier</codeph>) to 0.
The alpha transparency multiplier and offset values do not change.</p>
<p class="- topic/p ">When you pass a value for this property, use the format 0x<i class="+ topic/ph hi-d/i ">RRGGBB</i>.
<i class="+ topic/ph hi-d/i ">RR</i>, <i class="+ topic/ph hi-d/i ">GG</i>, and <i class="+ topic/ph hi-d/i ">BB</i> each consist
of two hexadecimal digits that specify the offset of each color component. The 0x
tells the ActionScript compiler that the number is a hexadecimal value.</p>
</apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:Point" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Point</apiName><shortdesc class="- topic/shortdesc ">
The Point object represents a location in a two-dimensional coordinate system, where x
represents the horizontal axis and y represents the vertical axis.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">The Point class represents a location in a two-dimensional coordinate system.
</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The Point object represents a location in a two-dimensional coordinate system, where <i class="+ topic/ph hi-d/i ">x</i>
represents the horizontal axis and <i class="+ topic/ph hi-d/i ">y</i> represents the vertical axis.
<p class="- topic/p ">The following code creates a point at (0,0):</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">var myPoint:Point = new Point();</codeblock>
<p class="- topic/p ">Methods and properties of the following classes use Point objects:</p>
<ul class="- topic/ul "><li class="- topic/li ">BitmapData</li><li class="- topic/li ">DisplayObject</li><li class="- topic/li ">DisplayObjectContainer</li><li class="- topic/li ">DisplacementMapFilter</li><li class="- topic/li ">NativeWindow</li><li class="- topic/li ">Matrix</li><li class="- topic/li ">Rectangle</li></ul>
<p class="- topic/p ">You can use the <codeph class="+ topic/ph pr-d/codeph ">new Point()</codeph> constructor to create a
Point object.</p>
</apiDesc><example conref="examples\PointExample.as" class="- topic/example "> The following example uses the PointExample class to create a number of new Point
objects at various <i class="+ topic/ph hi-d/i ">x,y</i> coordinates and then uses the <codeph class="+ topic/ph pr-d/codeph ">trace()</codeph> method to output the
results of various class methods.
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
import flash.display.Sprite;
import flash.geom.Point;
public class PointExample extends Sprite {
public function PointExample() {
var point1:Point = new Point();
trace(point1); // (x=0, y=0)
var point2:Point = new Point(6, 8);
trace(point2); // (x=6, y=8)
trace(Point.interpolate(point1, point2, 0.5)); // (x=3, y=4)
trace(Point.distance(point1, point2)); // 10
trace(point1.add(point2)); // (x=6, y=8)
var point3:Point = point2.clone();
trace(point2.equals(point3)); // true
point3.normalize(2.5);
trace(point3); // (x=1.5, y=2)
trace(point2.subtract(point3)); // (x=4.5, y=6)
trace(point1.offset(2, 3)); //
var angle:Number = Math.PI * 2 * (30 / 360); // 30 degrees
trace(Point.polar(4, angle)) // (x=3.464101615137755, y=1.9999999999999998)
}
}
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#BitmapData" class="- topic/link "><linktext class="- topic/linktext ">flash.display.BitmapData</linktext></link><link href="flash.display.xml#DisplayObject" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject</linktext></link><link href="flash.display.xml#DisplayObjectContainer" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObjectContainer</linktext></link><link href="flash.filters.xml#DisplacementMapFilter" class="- topic/link "><linktext class="- topic/linktext ">flash.filters.DisplacementMapFilter</linktext></link><link href="flash.geom.xml#Matrix" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix</linktext></link><link href="flash.display.xml#NativeWindow" class="- topic/link "><linktext class="- topic/linktext ">flash.display.NativeWindow</linktext></link><link href="flash.geom.xml#Rectangle" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Rectangle</linktext></link></related-links><apiConstructor id="flash.geom:Point:Point" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Point</apiName><shortdesc class="- topic/shortdesc ">
Creates a new point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The first example creates <code>point_1</code> with the default constructor.
<listing version="2.0">
import flash.geom.Point;
var point_1:Point = new Point();
trace(point_1.x); // 0
trace(point_1.y); // 0
</listing>
The second example creates <code>point_2</code> with the coordinates x = 1 and y = 2.
<listing version="2.0">
import flash.geom.Point;
var point_2:Point = new Point(1, 2);
trace(point_2.x); // 1
trace(point_2.y); // 2
</listing>
</maelexample></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">x</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The horizontal coordinate.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">y</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The vertical coordinate.
</apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates a new point. If you pass no parameters to this method, a point is created at (0,0).
</apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.geom:Point:add" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">add</apiName><shortdesc class="- topic/shortdesc ">
Adds the coordinates of another point to the coordinates of this point to create a new point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a Point object <code>resultPoint</code> by adding <code>point_2</code> to
<code>point_1</code>.
<listing version="2.0">
import flash.geom.Point;
var point_1:Point = new Point(4, 8);
var point_2:Point = new Point(1, 2);
var resultPoint:Point = point_1.add(point_2);
trace(resultPoint.toString()); // (x=5, y=10)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The new point.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">v</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point to be added.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Adds the coordinates of another point to the coordinates of this point to create a new point.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Point:clone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">clone</apiName><shortdesc class="- topic/shortdesc ">
Creates a copy of this Point object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a <code>clonedPoint</code> from the values found in
<code>myPoint</code>. The <code>clonedPoint</code> contains all the
the values from <code>myPoint</code> but is not the same object.
<listing version="2.0">
import flash.geom.Point;
var myPoint:Point = new Point(1, 2);
var clonedPoint:Point = myPoint.clone();
trace(clonedPoint.x); // 1
trace(clonedPoint.y); // 2
trace(myPoint.equals(clonedPoint)); // true
trace(myPoint === clonedPoint); // false
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The new Point object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Creates a copy of the Point object.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates a copy of this Point object.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Point:distance" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">distance</apiName><shortdesc class="- topic/shortdesc ">
Returns the distance between pt1 and pt2.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The distance between the first and second points.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pt1</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The first point.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pt2</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The second point.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns the distance between <codeph class="+ topic/ph pr-d/codeph ">pt1</codeph> and <codeph class="+ topic/ph pr-d/codeph ">pt2</codeph>.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Point:equals" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">equals</apiName><shortdesc class="- topic/shortdesc ">
Determines whether two points are equal.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">A value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the object is equal to this Point object; <codeph class="+ topic/ph pr-d/codeph ">false</codeph> if it is not equal.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">toCompare</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point to be compared.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines whether two points are equal. Two points are equal if they have the same <i class="+ topic/ph hi-d/i ">x</i> and
<i class="+ topic/ph hi-d/i ">y</i> values.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Point:interpolate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">interpolate</apiName><shortdesc class="- topic/shortdesc ">
Determines a point between two specified points.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example locates the interpolated point (<code>interpolatedPoint</code>) half way (50%) between <code>point_1</code> and <code>point_2</code>.
<listing version="2.0">
import flash.geom.Point;
var point_1:Point = new Point(-100, -100);
var point_2:Point = new Point(50, 50);
var interpolatedPoint:Point = Point.interpolate(point_1, point_2, .5);
trace(interpolatedPoint.toString()); // (x=-25, y=-25)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The new, interpolated point.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pt1</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The first point.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">pt2</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The second point.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">f</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The level of interpolation between the two points. Indicates where the new point will be, along the line
between <codeph class="+ topic/ph pr-d/codeph ">pt1</codeph> and <codeph class="+ topic/ph pr-d/codeph ">pt2</codeph>. If <codeph class="+ topic/ph pr-d/codeph ">f</codeph>=1, <codeph class="+ topic/ph pr-d/codeph ">pt1</codeph> is returned; if
<codeph class="+ topic/ph pr-d/codeph ">f</codeph>=0, <codeph class="+ topic/ph pr-d/codeph ">pt2</codeph> is returned.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Determines a point between two specified points. The parameter <codeph class="+ topic/ph pr-d/codeph ">f</codeph>
determines where the new interpolated point is located relative to the two end points
specified by parameters <codeph class="+ topic/ph pr-d/codeph ">pt1</codeph> and <codeph class="+ topic/ph pr-d/codeph ">pt2</codeph>. The closer the value of the parameter
<codeph class="+ topic/ph pr-d/codeph ">f</codeph> is to <codeph class="+ topic/ph pr-d/codeph ">1.0</codeph>, the closer the interpolated point is to the
first point (parameter <codeph class="+ topic/ph pr-d/codeph ">pt1</codeph>). The closer the value of the parameter <codeph class="+ topic/ph pr-d/codeph ">f</codeph> is
to 0, the closer the interpolated point is to the second point (parameter <codeph class="+ topic/ph pr-d/codeph ">pt2</codeph>).
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Point:normalize" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">normalize</apiName><shortdesc class="- topic/shortdesc ">
Scales the line segment between (0,0) and the current point to a set length.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example extends the length of the <code>normalizedPoint</code> object from 5 to 10.
<listing version="2.0">
import flash.geom.Point;
var normalizedPoint:Point = new Point(3, 4);
trace(normalizedPoint.length); // 5
trace(normalizedPoint.toString()); // (x=3, y=4)
normalizedPoint.normalize(10);
trace(normalizedPoint.length); // 10
trace(normalizedPoint.toString()); // (x=6, y=8)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The normalized point.
</apiDesc><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">thickness</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The scaling value. For example, if the current point is (0,5),
and you normalize it to 1, the point returned is at (0,1).
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Scales the line segment between (0,0) and the current point to a set length.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point/length" class="- topic/link "><linktext class="- topic/linktext ">length</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Point:offset" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">offset</apiName><shortdesc class="- topic/shortdesc ">
Offsets the Point object by the specified amount.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dx</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The amount by which to offset the horizontal coordinate, <i class="+ topic/ph hi-d/i ">x</i>.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">dy</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The amount by which to offset the vertical coordinate, <i class="+ topic/ph hi-d/i ">y</i>.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Offsets the Point object by the specified amount. The value of <codeph class="+ topic/ph pr-d/codeph ">dx</codeph> is added
to the original value of <i class="+ topic/ph hi-d/i ">x</i> to create the new <i class="+ topic/ph hi-d/i ">x</i> value. The value
of <codeph class="+ topic/ph pr-d/codeph ">dy</codeph> is added to the original value of <i class="+ topic/ph hi-d/i ">y</i> to create the new <i class="+ topic/ph hi-d/i ">y</i> value.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Point:polar" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">polar</apiName><shortdesc class="- topic/shortdesc ">
Converts a pair of polar coordinates to a Cartesian point coordinate.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a Point object <code>cartesianPoint</code> from the value of <code>angleInRadians</code>
and a line length of 5. The <code>angleInRadians</code> value equal to Math.atan(3/4)
is used because of the characteristics of right triangles with sides that
have ratios of 3:4:5.
<listing version="2.0">
import flash.geom.Point;
var len:Number = 5;
var angleInRadians:Number = Math.atan(3/4);
var cartesianPoint:Point = Point.polar(len, angleInRadians);
trace(cartesianPoint.toString()); // (x=4, y=3)
</listing>
When computers work with transcendental numbers such as pi, some round-off
error occurs because floating-point arithmetic has only finite precision.
When you use <code>Math.PI</code>, consider using the <code>Math.round()</code> function, as shown
in the following example.
<listing version="2.0">
import flash.geom.Point;
var len:Number = 10;
var angleInRadians:Number = Math.PI;
var cartesianPoint:Point = Point.polar(len, angleInRadians);
trace(cartesianPoint.toString()); // should be (x=-10, y=0), but is (x=-10, y=1.22460635382238e-15)
trace(Math.round(cartesianPoint.y)); // 0
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The Cartesian point.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">len</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The length coordinate of the polar pair.
</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">angle</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The angle, in radians, of the polar pair.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Converts a pair of polar coordinates to a Cartesian point coordinate.
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point/length" class="- topic/link "><linktext class="- topic/linktext ">length</linktext></link><link href="#Math/round()" class="- topic/link "><linktext class="- topic/linktext ">Math.round()</linktext></link></related-links></apiOperation><apiOperation id="flash.geom:Point:subtract" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">subtract</apiName><shortdesc class="- topic/shortdesc ">
Subtracts the coordinates of another point from the coordinates of this point to create a new
point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates <code>point_3</code> by subtracting <code>point_2</code> from <code>point_1</code>.
<listing version="2.0">
import flash.geom.Point;
var point_1:Point = new Point(4, 8);
var point_2:Point = new Point(1, 2);
var resultPoint:Point = point_1.subtract(point_2);
trace(resultPoint.toString()); // (x=3, y=6)
</listing>
</maelexample></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The new point.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">v</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Point</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The point to be subtracted.
</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Subtracts the coordinates of another point from the coordinates of this point to create a new
point.
</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.geom:Point:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
Returns a string that contains the values of the x and y coordinates.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The string representation of the coordinates.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Returns a string that contains the values of the x and y coordinates.
</apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns a string that contains the values of the <i class="+ topic/ph hi-d/i ">x</i> and <i class="+ topic/ph hi-d/i ">y</i> coordinates.
The string has the form <codeph class="+ topic/ph pr-d/codeph ">"(x=<i class="+ topic/ph hi-d/i ">x</i>, y=<i class="+ topic/ph hi-d/i ">y</i>)"</codeph>, so calling the <codeph class="+ topic/ph pr-d/codeph ">toString()</codeph>
method for a point at 23,17 would return <codeph class="+ topic/ph pr-d/codeph ">"(x=23, y=17)"</codeph>.
</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.geom:Point:x" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">x</apiName><shortdesc class="- topic/shortdesc ">
The horizontal coordinate of the point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example sets the <i class="+ topic/ph hi-d/i ">x</i> (horizontal) coordinate of <code>myPoint</code> and gets <code>myX</code> from <code>myPoint.x</code>.
<listing version="2.0">
import flash.geom.Point;
var myPoint:Point = new Point();
trace(myPoint.x); // 0
myPoint.x = 5;
trace(myPoint.x); // 5
var myX:Number = myPoint.x;
trace(myX); // 5
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The horizontal coordinate of the point. The default value is 0.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Point:y" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">y</apiName><shortdesc class="- topic/shortdesc ">
The vertical coordinate of the point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example sets the <i class="+ topic/ph hi-d/i ">y</i> (vertical) coordinate of <code>myPoint</code> and gets <code>myY</code> from <code>myPoint.y</code>.
<listing version="2.0">
import flash.geom.Point;
var myPoint:Point = new Point();
trace(myPoint.y); // 0
myPoint.y = 5;
trace(myPoint.y); // 5
var myY:Number = myPoint.y;
trace(myY); // 5
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The vertical coordinate of the point. The default value is 0.
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:Point:length:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">length</apiName><shortdesc class="- topic/shortdesc ">
The length of the line segment from (0,0) to this point.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><maelexample>The following example creates a new Point, <code>myPoint</code>, and determines the length of a line from (0, 0) to that Point.
<listing version="2.0">
import flash.geom.Point;
var myPoint:Point = new Point(3,4);
trace(myPoint.length); // 5
</listing>
</maelexample></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The length of the line segment from (0,0) to this point.
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Point/polar()" class="- topic/link "><linktext class="- topic/linktext ">Point.polar()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:Orientation3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Orientation3D</apiName><shortdesc class="- topic/shortdesc ">
The Orientation3D class is an enumeration of constant values for representing the orientation style
of a Matrix3D object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The Orientation3D class is an enumeration of constant values for representing the orientation style
of a Matrix3D object. The three types of orientation are Euler angles, axis angle, and quaternion.
The <codeph class="+ topic/ph pr-d/codeph ">decompose</codeph> and <codeph class="+ topic/ph pr-d/codeph ">recompose</codeph> methods of the Matrix3D object take one of these
enumerated types to identify the rotational components of the Matrix.
</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link><link href="flash.geom.xml#Transform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Transform</linktext></link><link href="flash.geom.xml#PerspectiveProjection" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.PerspectiveProjection</linktext></link></related-links><apiValue id="flash.geom:Orientation3D:AXIS_ANGLE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">AXIS_ANGLE</apiName><shortdesc class="- topic/shortdesc ">
The axis angle orientation uses a combination of an axis and an angle to determine the orientation.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">axisAngle</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The axis angle orientation uses a combination of an axis and an angle to determine the orientation.
A line or vector from the center of a three-dimensional globe to the surface is an example of an axis.
The axis around which the object is rotated is a unit vector that represents any possible direction
in the three-dimensional space. The angle represents the magnitude of the rotation
about the vector. The direction determines where a display object is facing and the roll angle determines
which way is up. You can use Vector3D and the Matrix3D objects to determine
the various matrix transformations as well as to determine important three-dimensional programming
values such as the distance to the intersection of two objects that can be used to detect simple
collision between three-dimensional objects.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.appendRotation()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.prependRotation()</codeph> methods
use the axis angle orientation.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/decompose()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.decompose()</linktext></link><link href="flash.geom.xml#Matrix3D/recompose()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.recompose()</linktext></link></related-links></apiValue><apiValue id="flash.geom:Orientation3D:EULER_ANGLES" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">EULER_ANGLES</apiName><shortdesc class="- topic/shortdesc ">
Euler angles, the default orientation for decompose() and recompose() methods,
defines the orientation with three separate angles of rotation for each axis.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">eulerAngles</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Defines the orientation with three separate angles of rotation for each axis.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Euler angles, the default orientation for <codeph class="+ topic/ph pr-d/codeph ">decompose()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">recompose()</codeph> methods,
defines the orientation with three separate angles of rotation for each axis. Usually,
a rotation around the x axis is followed by a rotation around the y axis, which is followed by a
rotation around the z axis.
<p class="- topic/p ">Euler angles can sometimes lead to animation errors because of problems such as singularities when
rotating around the x axis or gimbal lock. For example, since with Euler angles each axis is handled
independently, gimbal lock can occur during the rotation around two or more axes. The axes
can become aligned, leading to unexpected results.</p>
<p class="- topic/p ">The axis rotation properties of the display object perform Euler angles rotation.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/decompose()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.decompose()</linktext></link><link href="flash.geom.xml#Matrix3D/recompose()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.recompose()</linktext></link></related-links></apiValue><apiValue id="flash.geom:Orientation3D:QUATERNION" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">QUATERNION</apiName><shortdesc class="- topic/shortdesc ">
The quaternion orientation uses complex numbers.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">quaternion</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">An orientation in quaternion uses the three axes (x,y,z) and an angle of rotation (w).
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The quaternion orientation uses complex numbers. An orientation in quaternion is by the three axes of
rotation (x,y,z) and an angle of rotation (w). Quaternion guarantees the shortest, most efficient
path for the rotation. It also produces a smooth, gimbal-lock-free rotation. A gimbal lock can occur
when during the rotation around two or more axes the axes are aligned, leading to unexpected results.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">Matrix3D.interpolate()</codeph> method uses quaternion.</p>
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D/decompose()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.decompose()</linktext></link><link href="flash.geom.xml#Matrix3D/recompose()" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D.recompose()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.geom:PerspectiveProjection" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">PerspectiveProjection</apiName><shortdesc class="- topic/shortdesc ">
The PerspectiveProjection class provides an easy way to assign or modify the perspective
transformations of a display object and all of its children.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The PerspectiveProjection class provides an easy way to assign or modify the perspective
transformations of a display object and all of its children. For more complex or
custom perspective transformations, use the Matrix3D class. While the PerspectiveProjection
class provides basic three-dimensional presentation properties, the Matrix3D class
provides more detailed control over the three-dimensional presentation of display objects.
<p class="- topic/p ">Projection is a way of representing a three-dimensional object in a
two-dimensional space, like a cube projected onto a computer screen. Perspective projection uses a viewing
frustum (a rectangular pyramid) to model and project a three-dimensional world and its objects
on the screen. The viewing frustum becomes increasingly wider as it moves further from the origin
of the viewpoint. The origin of the viewpoint could be a camera or the eyes of an observer facing the screen.
The projected perspective produces the illusion of three dimensions with depth and distance,
where the objects closer to the screen appear larger than the objects farther from the screen.</p>
<p class="- topic/p "><adobeimage alt="Frustum viewing area" href="../../images/frustum.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<p class="- topic/p ">A default PerspectiveProjection object is a framework defined for perspective transformation
of the root object, based on the field of view and aspect ratio (dimensions) of the stage.
The projection center, the vanishing point, is set to the center of the stage, which means the
three-dimensional display objects disappear toward the center of the stage as they move
back in the z axis. The default viewpoint is at point (0,0) looking down the positive
z axis. The y-axis points down toward the bottom of the screen. You can
gain access to the <codeph class="+ topic/ph pr-d/codeph ">root</codeph> display object's perspective projection settings
and change the field of view and projection center properties of the <codeph class="+ topic/ph pr-d/codeph ">perspectiveProjection</codeph>
property through the <codeph class="+ topic/ph pr-d/codeph ">root</codeph> object's <codeph class="+ topic/ph pr-d/codeph ">DisplayObject.transform</codeph> property.</p>
<p class="- topic/p ">You can also set a different perspective projection setting for a display object through
the parent's perspective projection. First, create a PerspectiveProjection object and set
its <codeph class="+ topic/ph pr-d/codeph ">fieldOfView</codeph> and <codeph class="+ topic/ph pr-d/codeph ">projectionCenter</codeph> properties. Next, assign the
PerspectiveProjection object to the parent display object using
the <codeph class="+ topic/ph pr-d/codeph ">DisplayObject.transform</codeph> property. The specified projection matrix and transformation
will then apply to all the display object's three-dimensional children.</p>
</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObject/transform" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObject.transform</linktext></link><link href="flash.geom.xml#Transform" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Transform</linktext></link><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link><link href="flash.geom.xml#Utils3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Utils3D</linktext></link></related-links><apiConstructor id="flash.geom:PerspectiveProjection:PerspectiveProjection" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">PerspectiveProjection</apiName><shortdesc class="- topic/shortdesc ">
Creates an instance of a PerspectiveProjection object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
</helpid></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Creates an instance of a PerspectiveProjection object.
</apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.geom:PerspectiveProjection:toMatrix3D" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toMatrix3D</apiName><shortdesc class="- topic/shortdesc ">
Returns the underlying Matrix3D object of the display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The underlying Matrix3D object.
</apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.geom:Matrix3D</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Returns the underlying Matrix3D object of the display object.
<p class="- topic/p ">A display object, like the root object, can have a PerspectiveProjection object without
needing a Matrix3D property defined for its transformations. In fact, use either
a PerspectiveProjection or a Matrix3D object to specify the perspective transformation.
If when using the PerspectiveProjection object, a Matrix3D object was needed, the <codeph class="+ topic/ph pr-d/codeph ">toMatrix3D()</codeph>
method can retrieve the underlying Matrix3D object of the display object. For example, the
<codeph class="+ topic/ph pr-d/codeph ">toMatrix3D()</codeph> method can be used with the <codeph class="+ topic/ph pr-d/codeph ">Utils3D.projectVectors()</codeph>
method.</p>
</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#Matrix3D" class="- topic/link "><linktext class="- topic/linktext ">flash.geom.Matrix3D</linktext></link></related-links></apiOperation><apiValue id="flash.geom:PerspectiveProjection:fieldOfView:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fieldOfView</apiName><shortdesc class="- topic/shortdesc ">
Specifies an angle, as a degree between 0 and 180, for the field of view in three
dimensions.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Specifies an angle, as a degree between 0 and 180, for the field of view in three dimensions.
</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
Specifies an angle, as a degree between <codeph class="+ topic/ph pr-d/codeph ">0</codeph> and <codeph class="+ topic/ph pr-d/codeph ">180</codeph>, for the field of view in three
dimensions. This value determines how strong the perspective transformation and distortion apply to
a three-dimensional display object with a non-zero z-coordinate.
<p class="- topic/p ">A degree close to <codeph class="+ topic/ph pr-d/codeph ">0</codeph> means that the screen's two-dimensional x- and y-coordinates are
roughly the same as the three-dimensional x-, y-, and z-coordinates with little or
no distortion. In other words, for a small angle, a display object moving down the z axis appears
to stay near the same size and moves little. </p>
<p class="- topic/p ">A value close to <codeph class="+ topic/ph pr-d/codeph ">180</codeph> degrees results in a fisheye lens effect: positions
with a <codeph class="+ topic/ph pr-d/codeph ">z</codeph> value smaller than <codeph class="+ topic/ph pr-d/codeph ">0</codeph> are magnified, while positions with a
<codeph class="+ topic/ph pr-d/codeph ">z</codeph> value larger than <codeph class="+ topic/ph pr-d/codeph ">0</codeph> are minimized. With a large angle, a display object
moving down the z axis appears to change size quickly and moves a great distance. If the field of view
is set to <codeph class="+ topic/ph pr-d/codeph ">0</codeph> or <codeph class="+ topic/ph pr-d/codeph ">180</codeph>, nothing is seen on the screen.</p>
</apiDesc></apiValueDetail></apiValue><apiValue id="flash.geom:PerspectiveProjection:focalLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">focalLength</apiName><shortdesc class="- topic/shortdesc ">
The distance between the eye or the viewpoint's origin (0,0,0) and the display object located
in the z axis.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
The distance between the eye or the viewpoint's origin (0,0,0) and the display object located
in the z axis. During the perspective transformation, the <codeph class="+ topic/ph pr-d/codeph ">focalLength</codeph> is calculated dynamically
using the angle of the field of view and the stage's aspect ratio (stage width divided by
stage height).
</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.geom.xml#PerspectiveProjection/fieldOfView" class="- topic/link "><linktext class="- topic/linktext ">fieldOfView</linktext></link></related-links></apiValue><apiValue id="flash.geom:PerspectiveProjection:projectionCenter:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">projectionCenter</apiName><shortdesc class="- topic/shortdesc ">
A two-dimensional point representing the center of the projection, the vanishing point for the display object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.geom:Point</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
A two-dimensional point representing the center of the projection, the vanishing point for the display object.
<p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">projectionCenter</codeph> property is an offset to the default registration point that is the
upper left of the stage, point (0,0). The default projection transformation center is in the middle of
the stage, which means the three-dimensional display objects disappear toward the center of the stage
as they move backwards in the z axis.</p>
</apiDesc></apiValueDetail></apiValue></apiClassifier></apiPackage>