# How do I communicate between classes?

**URL:** <https://forum.kirupa.com/t/how-do-i-communicate-between-classes/301174>\
**Category:** flash\
**Created:** [December 4, 2009, 3:09pm UTC](https://forum.kirupa.com/t/how-do-i-communicate-between-classes/301174 "2009-12-04T15:09:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vidar](https://avatars.discourse-cdn.com/v4/letter/v/e36b37/32.png) [@Vidar](https://forum.kirupa.com/u/Vidar)\
**Post date:** [December 4, 2009, 3:09pm UTC](https://forum.kirupa.com/t/how-do-i-communicate-between-classes/301174/1 "2009-12-04T15:09:00Z")

</div>

[FONT=Arial]I am very new to OOP.  
I am trying to make a little game. In short words; you control a instance named player, and get attacked by children of the Enemy class.

How can all the children of “Enemy” know the coordinates to player instance, how can the document class and the Enemy class [/FONT][FONT=Arial][COLOR=#000000]exchange variables?

Thanks in advance:?)  
[/COLOR][/FONT]
