Wasn’t sure where to put this (maybe Computers & Games would have been better?)
But basically what I’m looking for is a way to access an variable in and object in the object that’s the parent of the class I’m in.
In flash I’d do something like
_parent.myObject.whatever
But I have no idea how to do this in Java. Any ideas?
Rephrased:
I’ve got a main object that creates two other objects, from within a method in one of the objects, I want to check the state of a variable in the other object that the main object created.
I’m not sure there’s an equivalent (though my Java is a little rusty). I’d just pass a reference to the parent object in the constructor of the child, then you’ll have the reference you want.
Wow, I can’t believe I didn’t think of passing it as a parameter. Thanks guys, I’ll try it next Wednesday when I go back to school and let you know how it turns out.