Juni Brosas Juni Brosas - 3 months ago 57
ActionScript Question

AS3 Event.ENTER_FRAME tips for game developer

Im new to flash game developing and currently i am developing my first game. RPG Action Game. I`m having a problem with ENTER_FRAME Event.

I currently have 3 ENTER_FRAME Events, from my document class, hero and ground. Each time I run the application, the flash player crashes.

What would be a good approach with this problem? I am thinking to have one main enterframe event which controls everything and change my design pattern.. T_T.

Answer Source

In your document class you could have:

addEventListener(Event.ENTER_FRAME, onEnter);
private function onEnter(e:Event):void
    //do other stuff    
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download