0

When ‘wmode’ in instigated and a user is playing a Flash game requiring arrow keys, on Internet Explorer the browser window also moves. Seemingly, the only way round this is to remove the ‘wmode.’ But, if the ‘wmode’ is removed the Flash game rises to the top of the stacking order and all other elements such as expandable banners or dropdown menus go behind the Flash. No amount of iFrames or CSS resolves this issue.

I have found a solution that lets the ‘wmode’ remain, whilst also enabling the Flash game to have keyboard focus once clicked and therefore the Internet Explorer browser window does not move. This solution means other Dom elements can go above the Flash.

I have put the AS3 code below into a simple example and it seems to work. It basically puts a scrollPane in the content and then this is made invisible.

Being a PHP developer and not an AS3 developer, my questions is – can any AS3 developers see an issue or detrimental impact of placing the code below into a Flash based/AS3 built game. Equally could this work in AS2?

Much appreciated

_scrollPane = new ScrollPane();
_scrollPane.setSize(stage.stageWidth, stage.stageHeight);
_scrollPane.horizontalScrollPolicy = ScrollPolicy.OFF;
_scrollPane.verticalScrollPolicy = ScrollPolicy.OFF;
_scrollPane.alpha=0;
stage.addChild(_scrollPane);
Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
  • This doesn't feel like an answer, so putting it here: I like your solution. I faced a similar problem while implementing keyboard navigation, and never resolved it. I don't think this will work in AS2. The only detriment I can see is adding UI elements to the screen which are never visible, but since they solve the problem there is no detriment only benefit :) – Sunil D. Jul 10 '12 at 16:29
  • Thanks Sunil I agree that adding an invisible UI component could possibly de detrimental but it does enable arrow key control whilst ensuring the stacking order remains in the Dom. What I have not yet tested is if the scrollPane gets in the way of mouse interaction with movie clips. One thing to note is that the focus is lost once a different browser tab is visited and then the user goes back to the original. It can only be regained by reloading the page. This would obviously be really annoying for someone in the middle of a game. – SimonPeacock Jul 10 '12 at 19:07
  • However, after sometime of research and testing this is the only solution that appears to fix both problems in Internet Explorer. Appreciate your opinion and welcome more :-) – SimonPeacock Jul 10 '12 at 19:07

1 Answers1

0

After a bit more testing it appears this is not realistically a viable option. Although the swf file gains focus once clicked and sprites requiring arrow key control can be moved without affecting the browser window, clicking or dragging interaction with sprites is prevented due to the child index of the scrollPane.

I’ve been playing around with the pre-release of IE10 and it appears no matter what state the wMode is left in (or removed) the browser window is still affected by arrow key interaction with the swf. If anyone else has come across this problem or found an answer it would be greatly appreciated.

Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51