Copy link to clipboard
Copied
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;
}
}
click file>publish settings>swf and tick "permit debugging". retest to confirm that class file is being used after checking your publish settings to confirm you're publishing for fp 10+.
Copy link to clipboard
Copied
Which version of Flash are you using? The z property did not exist in the first go around with AS3.
Copy link to clipboard
Copied
CS6, AS3, and I think Flash Player 11.9.
Copy link to clipboard
Copied
where's your package declaration?
Copy link to clipboard
Copied
package Jay
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;
Copy link to clipboard
Copied
click file>publish settings>swf and tick "permit debugging". retest to confirm that class file is being used after checking your publish settings to confirm you're publishing for fp 10+.
Copy link to clipboard
Copied
I was publishing for FP9, changed to 11.1 and worked fine. Thank you.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now