Skip to main content
Participating Frequently
October 19, 2013
Answered

3D in as3, "access of undefined property z"?

  • October 19, 2013
  • 2 replies
  • 1222 views

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;

                    }

     }

This topic has been closed for replies.
Correct answer kglad

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+.

2 replies

kglad
Community Expert
Community Expert
October 19, 2013

where's your package declaration?

Participating Frequently
October 19, 2013

package Jay

{

          import flash.display.MovieClip;

          import flash.display.Stage;

          import flash.events.Event;

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 19, 2013

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+.

Ned Murphy
Legend
October 19, 2013

Which version of Flash are you using?  The z property did not exist in the first go around with AS3.

Participating Frequently
October 19, 2013

CS6, AS3, and I think Flash Player 11.9.