IE arrow keys issue

10 views
Skip to first unread message

Ernesto Quezada

unread,
Jul 21, 2008, 10:43:34 AM7/21/08
to swfo...@googlegroups.com
Hi there,
trust me I checked the discussions on google groups before writing this email but for for any strange reason I can't read any discussion.
This is my problem:
- I've got a games portal and of course I've opted for swfobject to embed flash content
- I'm using wmode=opaque so the games run faster
- There are games that use arrow keys and when played on IE, the arrows control the scrollbar and the game at the same time and it's annoying so many people opt for leaving my site :(

Using IE, you can see this problem on this game (for example).

Any fix?
'cause I know embedding using other technique works fine as soon as it's not wmode=transparent.

thanks!
Ernesto Quezada

--
http://www.games-garden.com/

Getify Solutions

unread,
Jul 21, 2008, 11:15:01 AM7/21/08
to swfo...@googlegroups.com
A few ideas:
1. Try not putting any wmode parameter on there... I personally consider wmode to be quite buggy and I'm trying to force myself to figure out how not to use it whenever I can. It would appear from your page design that the wmode for the game isn't that important, so this is just possible thing you could try.  I doubt this is the cause, but I've seen much stranger issues resolved by removing wmode, so, worth a shot.
 
2 Try swfobject's static publishing instead of dynamic publishing.
 
3 (DISCLAIMER: this suggestion is not SWFObject related, but just general HTML/Javascript authoring, which is off topic for this list so we probably can't help too much with nitty gritty details, and your mileage may vary).  In your page's HTML/Javascript, if you set up event handlers for keypress/keydown/keyup for the window/document, and you trap for the arrow keys, and you cancel the event handler bubbling and event response cycle, you should be able to shut down the window scrolling with arrow keys.  This would leave the flash as the only asset who would respond positively to such key events.
 
Downside is that it shuts it off for the whole page, not just when the user is playing and needs game control.  So, you could have some kind of Javascript flag (true/false variable) that either applied these key filtering rules only when the flash object has the focus (you can set an onfocus/onblur event handlers directly on the swf's object itself via javascript -- see swfobject.getObjectById), or even more robust, have the game swf itself make a call out to the container javascript (fscommand, ExternalInterface, etc) and control the value of this variable dynamically as the game progresses, only shutting off the key event filtering while an actual level is being played and restoring it when not, etc.
 
Obviously #3 is more complicated and less desirable.  Sad smile emoticon  I'd try to avoid this solution if possible, but it is likely doable if nothing else works.
 
 
--Kyle

Ernesto Quezada

unread,
Jul 21, 2008, 5:39:54 PM7/21/08
to swfo...@googlegroups.com
Hey Kyle,
thanks for your reply.
I tried removing wmode and it works fine now but...
games with balls (does it sound funny or is only me?) run a bit slower now :(
there are a couple of pong games that run really slow, specially on firefox 2 (on firefox 3 seems like swf files run faster than on firefox 2) but hey, at least people won't compain about the IE issue anymore.

Thanks again!

Ernesto


2008/7/21 Getify Solutions <get...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages