Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global event listener for keyboard (as3)

Status
Not open for further replies.

krymzon

Programmer
Feb 22, 2005
38
0
0
CA
(the following concerns only actionscript 3. Any suggestions in as3 are greatly appriciated)
hey,
I've been wondering if there is a quick and painless way to add a keyboard event handler to an entire fla, as apposed to a single element on the form.
Basically, what I'm saying is, I understand the concept of applying a listener to an object, but I'd benefit more from an event listener, listening to keyboard input, that isn't bound to an object, but is always triggered regardless of the current focus.

I might not be clear on my intentions, so I'll give an example. I have a form with a movieclip, a textfield, and a bitmap on the stage. Now i want to add an event listener to listen to keyboard input, but i don't want the listener to be added to any of the thing on the stage, ie. the movieclip, textfield... Instead I want a event listener that works on a higher level then those items, and always fires regardless of current focus.
In AS2, key.addlistener(receivingOBJ) is similar to what i want to achieve. Anyone have any advice on how to add this kind of functionality?

--there are 10 types of people in this world. those who know binary, and those who don't.--
 
well...
never mind. seems adding it to stage works. Odd, i could have sworn i tried that before. Sorry for wasting your time if you read my question. haha.
But consider it moral support. Thanks!

--there are 10 types of people in this world. those who know binary, and those who don't.--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top