-1

I have a flex application with multiple tabs. If a user moves to the second tab, I need to disable the F5 (Refresh) key. How can I do it for IE?

I am not able to catch an event in case of F5, browser catches its first and refreshes the whole application. I don't want that to happen.

I guess IE runs a flash application as activex and in IE F5 key is not passed to activex, this is because I am facing such a problem. Is it correct?

Any solution?

2 Answers2

1

You can do this from javascript. Stop the browser refresh as mentioned here and here.

Community
  • 1
  • 1
Zeus
  • 6,386
  • 6
  • 54
  • 89
0

add keydown event listener in your html file such like:

function (e):{
    if (e.keycode == keyboard.F5){
        // game.preventEvent is a interface your app provide to 
        // decide stop event or not
        if (game.preventEvent){
            e.preventdefault()
        }
}
twoyao
  • 1
  • 1
  • Thanks @twoyao.. But this would disable the F5 for the whole application. I need to disable F5 only when I am on a particular tab in my application. – user3217804 Jan 26 '14 at 05:32
  • This code only works when my flex application gets loaded and I click F5. But if I perform some actions/clicks on my application and then do F5 the page gets refreshed. – user3217804 Jan 28 '14 at 05:26