answered question

answers (2)

ilaksh
0
Votes
BEST ANSWER  chosen by asker   |  ilaksh  |  January 04, 2009 06:00 PM
There might be some security or other exception that is preventing it from executing some of your code. When you say running in debug mode, you are probably in CS3 right? Maybe when you test externally you could use the debug version of Flash player which is available on the downloads page. Its different from the normal Flash player version.

Also try creating a sprite or other object, adding that to the stage, specifying position and dimensions of the object, and listening to events on that object.
Asker's rating:  
You were kind of right. I needed to turn off shortcut processing from the control menu of the flash player when running the movie. That's just SOO obvious. I still don't know why debug mode is different. Perhaps it's a player bug. Anyway, problem solved. Thanks.

Comment
cyberangel
0
Votes
cyberangel  |  January 04, 2009 07:22 AM
I believe that
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, KeyPressed);

creates a listener on this to stage for Event.KEY_DOWN. but stage should never dispatch Event.KEY_DOWN.

Another words... the eventListener declaration has to happen within the object you want to listen for the event, the above code tells this to listen for an event from stage, it doesn't tell stage to listen for an event.
Comment
140

ask any question

Top of Page
Buy Mahalo Dollars
WITH CREDIT CARD OR PAYPAL

Please log in to use this function.