Groups | Blog | Home
all groups > flash actionscript > october 2005 >

flash actionscript : Delete Key with no TextBox in focus


unthinkMedia
10/13/2005 11:08:42 PM
Anyone know how to use Key.isDown for the Delete Key when a text box is not in
focus?
This is what i have and it works fine as long as i am inside a text box.

keyListener = new Object();
keyListener.onKeyDown = function() {
trace("KEY DOWN")
if (Key.isDown(Key.DELETEKEY) || Key.isDown(Key.BACKSPACE)) {
trace("DELETE");
}
};
Key.addListener(keyListener);

Problem is that i am building an application that requires me to use the
delete key for 2 purpuses.

1) to delete charectors in a text box, which obviously works fine
2)when text box is not focus you could select the movieClip that it lives in
and Delete the entire clip(This is where the problem is)

Delete isn't registering if i don't have textfield in focus

There has to be some sort of work around cause this seems like something that
is pretty normal usabilitywise.


unthinkMedia
10/13/2005 11:10:34 PM
AddThis Social Bookmark Button