USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 11/5/09 02:42 AM
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)
Posted at: 11/5/09 04:15 AM
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
Posted at: 11/5/09 04:49 AM
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?
Posted at: 11/5/09 05:13 AM
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
Posted at: 11/5/09 07:43 AM
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