Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Thread Tools Rate Thread Display Modes
Old 07-18-2012, 05:23 AM   #1
Registered User
Join Date: May 2011
Posts: 40
Default Keyboard Buttons Don't React Until SWF Is Clicked

I made a simple flash game with a play button at the beginning, but the arrow keys don't move the object until I click on the swf. I put it in an html file and it still wouldn't work. Any help would be appreciated.
Petaminx is offline   Reply With Quote
Old 07-18-2012, 01:36 PM   #2
Senior Member
Join Date: Aug 2008
Location: Helsinki, Finland
Posts: 1,182

The swf object should be "in focus" or "active" before it starts corresponding to the user interactions. If you want to set it active without clicking it first, you probably need to use some kind of an "auto focus script" on html page which you should be able to do with javascript. Perhaps this advice will solve the problem.
-:)lauri is offline   Reply With Quote
Old 07-18-2012, 03:41 PM   #3
Registered User
Join Date: May 2011
Posts: 40

Is there any way to do this with ActionScript? When I press Ctrl-Enter, this issue still occurs. I just want to avoid that problem when it isn't in html, but the problem occurs whether or not it is in html.
Petaminx is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:37 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.