# Simple Object Question

**URL:** <https://forum.kirupa.com/t/simple-object-question/299883>\
**Category:** Uncategorized\
**Created:** [November 12, 2009, 6:15am UTC](https://forum.kirupa.com/t/simple-object-question/299883 "2009-11-12T06:15:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heli](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@Heli](https://forum.kirupa.com/u/Heli)\
**Post date:** [November 12, 2009, 6:15am UTC](https://forum.kirupa.com/t/simple-object-question/299883/1 "2009-11-12T06:15:18Z")

</div>

I feel really dumb for asking this but…

I have two objects. Car and Gun. They are both in their separate classes and I have a main doc class called Main.

I need to tell Gun that Car is at a specific location x,y so it follows along. Now, I’m able to access the public variables and use Car.getX() and Car.getY() which actually I don’t even need since I can just use .x and .y but I tried both methods work IN the doc class “Main”

When I try the same from the “Gun” class so that I know where Car is I get an error. “Access of undefined property dudeCar”

“dudeCar” is what I called the physical “Car” class movie clip on stage.

So what am I doing wrong? How can I talk between these two separate “Gun” and “Car” classes without using the “Main” doc class?

Thank you in advance for reading and possibly answering.
