Copy link to clipboard
Copied
I've got a game that accepts and responds to keyboard input just fine if I run the .swf file in Flash Player. However, when I open a Firefox browser and click Open file... for this .swf file, everything except keyboard input works (collision detection, AI, animation, etc.).
Any clue why?
1 Correct answer
you can force focus in AS but you might have to find a js script to also give the swf object focus on the page.
stage.focus=__
Copy link to clipboard
Copied
i don't see that problem.
what code are you using?

Copy link to clipboard
Copied
Firefox has a known issue with FOCUS mouse and keyboard. do you have a mac perchance?
Copy link to clipboard
Copied
Nope, I've got a Dell running on Windows Vista.
According to the Adobe website, "You have version 10,0,42,34 installed" So I have the latest Firefox plugin... =/
I just tried Internet Explorer, too... Won't take the keyboard input. All the other stuff works.
[EDIT]: Oh hell, I clicked inside the window and then it worked. But I had to click in the window. Any way around this? (I guess I can make players "Click to Start" the game...)
Just removed my wall of text of code since it's a browser issue...
I heard that you can detect when the focus is out of the window and do something about it, but I have no idea how. And the person was talking about javascript.
Copy link to clipboard
Copied
your code works for me running firefox. (assuming you see no compiler errors.)
Copy link to clipboard
Copied
Thanks guys... I'm not even sure what to look up when trying to find out how to work around the browser focus issue with code. Typing "browser focus issues" would just give me lots of complaints about the issues... Any suggestions?
Is it even possible to detect focus problems and then do something about it with ActionScript?

Copy link to clipboard
Copied
you can force focus in AS but you might have to find a js script to also give the swf object focus on the page.
stage.focus=__
Copy link to clipboard
Copied
Thanks, I'll keep that in mind for later.

Copy link to clipboard
Copied
Pretty much it is a security issue to stop people from writing flash keyloggers and things like that. So any "fix" you did find would likely stop working when the next update of the flash plugin is released.
Generally it is pretty easy to have some kind of start or continue or some such button that will allow you to get that click in a way that doesn't seem at all awkward.

