Flash player notified on browser close or change page (as3)

后端 未结 3 1815
我在风中等你
我在风中等你 2020-12-15 13:20

I have to detect in my flash if the user closes his browser or goes to another page and the flash is not accessible anymore. How do i achieve that ?

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-15 13:55

    The above worked great for me with one exception: if I return null as my string, I don't want any message to pop up. It works for all browsers except IE, which brings up a dialog box that says "null".

    That can be corrected by altering one line to add a null check:

    var jsBindEvent:String = "function(){"+qualifiedEventName+"= function(){if (" + jsExecuteCallBack + ") return "+jsExecuteCallBack+"};}";
    

提交回复
热议问题