Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Oct 19, 2013 Oct 19, 2013

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;

                    }

     }

TOPICS
ActionScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 19, 2013 Oct 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+.

Translate
LEGEND ,
Oct 19, 2013 Oct 19, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 19, 2013 Oct 19, 2013

CS6, AS3, and I think Flash Player 11.9.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2013 Oct 19, 2013

where's your package declaration?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 19, 2013 Oct 19, 2013

package Jay

{

          import flash.display.MovieClip;

          import flash.display.Stage;

          import flash.events.Event;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2013 Oct 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+.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 19, 2013 Oct 19, 2013

I was publishing for FP9, changed to 11.1 and worked fine. Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2013 Oct 19, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines