|
-
How to cancel Bubble on Keyboard Event?
I'm trying to trap the "TAB" key so that it only changes the focus of input text boxes in my movie. I have used the following code. The code works however, the event bubbles up and objects in the movie change focus as the "TAB" key is pressed.
I have tried returning both "true" and "false" in my listener and it makes no difference.
Any help would be appreciated.
Code:
Code:
//Tab Key handler
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if(Key.isDown(Key.TAB))
{
if(Key.isDown(Key.SHIFT))
{
_root.voucher.prev_text_box();
}else
{
_root.voucher.next_text_box();
}
}
};
Key.addListener(keyListener);
-
Registered User
hi,
From what I understand, all you need is using the tabIndex property for the text fields you want to tab trough.
-
 Originally Posted by nunomira
hi,
From what I understand, all you need is using the tabIndex property for the text fields you want to tab trough.
Correct! Just want to let you know that in javascript there is a function called stopPropogation which does this.. Flash has something similar... SOrry Im very very new to flash.
-
 Originally Posted by nunomira
hi,
From what I understand, all you need is using the tabIndex property for the text fields you want to tab trough.
Thanks Guys,
nunomira, actually I'm using the Tab to move to a new frame as well as select text in an input text box.
What is currently happening when I press "TAB" is that it cycles through selecting text boxes and then selects other objects like buttons etc. I want to stop the default "TAB" action from selecting objects so that I can dictate what occurs.
The reply from 'kaliopi' is more what I'm looking for but I can't find it anywhere.
Regards,
Alan
-
Registered User
Ok,
In this case, instead of restincting the tab to those text fields, disable it from all the other objects using the tabEnabled property.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|