Posted By

arpo on 10/08/09


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Demian
sweetbabyyoung


Reload Firefox on F5 key press


 / Published in: ActionScript 3
 

This little snippet will solve the problem with Firtefox not reloading when you press F5 if this focus is in the flash embed in the browser.

  1. //Place this in the import section.
  2. import flash.external.ExternalInterface;
  3.  
  4. //Place this some where in your code where you can access the stage object.
  5. stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandlerfunction);
  6.  
  7.  
  8. private function keyHandlerfunction(e:KeyboardEvent):void
  9. {
  10. if (e.keyCode == 116) {
  11. ExternalInterface.call("window.location.reload()");
  12. }
  13. }

Report this snippet  

You need to login to post a comment.