3D in as3, "access of undefined property z"?
Hi,
Recently, I've reading a couple tutorials on 3D in AS3. So far, I've read that all you have to do to convert a 2D movie clip to 3D is define the z property of the MoviClip class. The problem is: when I try to run my 3D project, I get the error: "access of undefined property z" and I don't know why.
Any answer would help a lot. Thanks in advance!
Code for TheeDClip class (meant to be extended in symbol definition classes):
public class ThreeDClip extends MovieClip
{
public function ThreeDClip(_stage:Stage, _followup:Function, _x:Number = .000378, _y:Number = .000378, _z:Number = .000378)
{
super();
addEventListener(Event.ADDED_TO_STAGE, function(evt:Event)
{
_followup();
});
_stage.addChild(this);
if (_x != .000378)
x = _x;
else
x = _stage.stageWidth / 4;
if (_y != .000378)
y = _y;
else
y = _stage.stageWidth / 4;
if (_z != .000378)
z = _z;
else
z = 100;
}
}
