I have a class named Box
that extends Sprite
and when I'm trying to access his transform.matrix3D
property (indeed is the matrix3D
property from an Transform
object) this returns me null
. Why?
package some.place
{
// ... imports ...
public class Box extends Sprite
{
public function Box() {}
public function DoSomething():void
{
var m:Matrix3D = transform.matrix3D;
开发者_StackOverflow中文版 // here m == null !!! Why???
}
}
}
By default 2D object have no matrix3D
, i.e. if you have not use any 3D stuff (z property, rotationY,etc ...) with your DisplayObject
you will have a null matrix.
N.B. You can also set the matrix3D to null to reset back you object in 2D
The value of the z property of a 2D object is zero and the value of its matrix3D property is null.
精彩评论