Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

No keyboard input detection when running in Firefox?

New Here ,
Dec 19, 2009 Dec 19, 2009

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?

TOPICS
ActionScript
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Dec 19, 2009 Dec 19, 2009

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=__

Translate
Community Expert ,
Dec 19, 2009 Dec 19, 2009

i don't see that problem.

what code are you using?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 19, 2009 Dec 19, 2009

Firefox has a known issue with FOCUS mouse and keyboard. do you have a mac perchance?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 19, 2009 Dec 19, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2009 Dec 19, 2009

your code works for me running firefox.  (assuming you see no compiler errors.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 19, 2009 Dec 19, 2009

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 19, 2009 Dec 19, 2009

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=__

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 19, 2009 Dec 19, 2009

Thanks, I'll keep that in mind for later.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 20, 2009 Dec 20, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines