Handling Multiple Classes

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.