user967007
user967007

Reputation:

as3 flash, browser, tabs and focus

When I have several tabs open in my browser, I can cycle through them using ctrltab, however if at any time I bring a flash app to focus then ctrltab no longer works... I manually have to click somwhere outside the flash area and then ctrltab...

Is there a way for either

(a) the html that contains the flash to catch the ctrltab and steal it from flash

(b) the flash captures the ctrltab releases it's focus to the browser (and notifies it or passes through the ctrltab event )..

I'm sure this has been asked before, and I'm sure if there is no way to do this, it must bug the hell out of developers..

Any ideas, hacks, suggestions ?

Upvotes: 3

Views: 402

Answers (1)

Kamari
Kamari

Reputation: 83

I'm no expert, but I'm to understand that the ctrltab thing is a built-in hotkey for cycling through members of an array (like internet window tabs, buttons, or even language settings). If that is indeed the case, the I would think the only way to do what I believe you are suggesting is to put a bit of code in the actual Flash movie/file that says to ignore the ctrltab key combination.

function f_keyDown(event:KeyboardEvent):void {
    // Keyboard.TAB == 9
    if (Event.keyCode == Keyboard.TAB) {
        trace('Pressed the TAB key!');
        if (event.ctrlKey == true) {
            //the CTRL key on Windows; the COMMAND key on Macs;
            trace('Pressed the CTRL key!');
            //something i don't know XD
        }
    }
}

stage.addEventListener(KeyboardEvent.KEY_DOWN, f_keyDown);

You might have to mess with the FocusManager class... I am unsure how you would go about it. Hope I helped a little...

Upvotes: 1

Related Questions