Forum Topic: Class File Help As3 (3d)

(63 views • 4 replies)

This topic is 1 page long.

<< < > >>
Beaten

zenyara

Reply To Post Reply & Quote

Posted at: 11/5/09 02:42 AM

zenyara NEUTRAL LEVEL 13

Sign-Up: 06/17/05

Posts: 1,199

I am still learning AS3 and I'm stuck on one problem here.

I'm getting this error:

1120:Access of undefined property cam.

I am referencing the "cam" variable that is from the main.as file (class structure).

Any ideas of why it's not allowing me to get the cam variable from another class file?

I need this to work for the 3D engine we're building. Thanks for the help in advance.

Check out the latest updates:

Toga Games (crew)

BBS Signature

None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 11/5/09 04:15 AM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 11,418

It's private or you're not accessing the right object.

#ngprogramming at irc.freenode.net
haXe | Keel imperative | Spyro! | Thru you


Angry

zenyara

Reply To Post Reply & Quote

Posted at: 11/5/09 04:49 AM

zenyara NEUTRAL LEVEL 13

Sign-Up: 06/17/05

Posts: 1,199

At 11/5/09 04:15 AM, GustTheASGuy wrote: It's private or you're not accessing the right object.

I typed :

trace(root);

... into the subclass file and it traces:

NULL
NULL
NULL
NULL
etc...

Shouldn't it be tracing back the main.as class name?

Check out the latest updates:

Toga Games (crew)

BBS Signature

Questioning

zenyara

Reply To Post Reply & Quote

Posted at: 11/5/09 05:13 AM

zenyara NEUTRAL LEVEL 13

Sign-Up: 06/17/05

Posts: 1,199

I think I figured it out.

You have to create a global variable wrapper.

like this:
http://www.greenethumb.com/article/11/gl obal-variables-in-as3

Check out the latest updates:

Toga Games (crew)

BBS Signature

None

henke37

Reply To Post Reply & Quote

Posted at: 11/5/09 07:43 AM

henke37 NEUTRAL LEVEL 23

Sign-Up: 09/10/04

Posts: 3,641

If root is null, the object is not on the displaylist.

Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.


All times are Eastern Standard Time (GMT -5) | Current Time: 01:53 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!