# Handling Multiple Classes

**URL:** https://forum.kirupa.com/t/handling-multiple-classes/327685
**Category:** flash
**Created:** [March 20, 2012, 10:36am UTC](https://forum.kirupa.com/t/handling-multiple-classes/327685 "2012-03-20T10:36:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![12abhi12](https://avatars.discourse-cdn.com/v4/letter/1/9f8e36/32.png) [@12abhi12](https://forum.kirupa.com/u/12abhi12)
#### Post date: [March 20, 2012, 10:36am UTC](https://forum.kirupa.com/t/handling-multiple-classes/327685/1 "2012-03-20T10:36:16Z")

</div>

Its been a while I am learning as3. I have followed tutorials on classes and there is no doubt that I can make a class and work on it. But the problem is that I can’t grasp the concept of using multiple classes altogether.

For example, let’s take a game which uses the classes “mains” for the general code, “keys” for keyboard input, “player” for player properties, “enemies” for enemy properties. I have made the keys class. Now I want to handle every key input for the player in the mains class. Like, if the up arrow is pressed let the keys class generate a return value “up”. And then I can use the output for some code in Player. How may it be done? Then I hittest the player with enemy and want the enemy to die and player to loose a life. Do I have to write in both classes or what do I do?

Please help I am thoroughly confused.

If you can redirect to a page which uses multiple classes (like, 3 or 4) then you are most welcome. I can’t seem to find any. They need not be relevant to classes, any topic would do. I just need to see the functioning.

Thanks in advance.
