Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex ExternalInterface not firing in Safari (works everwhere else!)
    primarykey
    data
    text
    <p>I know there have been other questions on getting JavaScript / Flex ExternalInterface to play nicely, but I've what I think is a weird one. It works perfectly in every browser <strong>except</strong> Safari (on a Mac). Chrome, IE, Firefox - all ok, but Safari, nope it just wont fire. I've copied my code below, can anyone see why it doesn't work in Safari pls ?</p> <p>(the 'are you sure' dialog window appears in Safari but the method in the Flex app just doesn't get called)</p> <p>Cheers Alex</p> <p>Flex code :</p> <pre><code> if(ExternalInterface.available){ ExternalInterface.addCallback("flexShutdownHandler",flexShutdownHandler); fnMyLogger("External interface available - setting shutdownhook"); }else{ fnMyLogger("External interface *NOT* available"); } private function flexShutdownHandler():void{ fnMyLogger("*****************"); fnMyLogger("** Logging out **"); fnMyLogger("*****************"); // other code as well here where I // can tell doesn't get called .... } </code></pre> <p>JavaScript code :</p> <pre><code> &lt;script language="JavaScript" type="text/javascript"&gt; function thisFlexApp(flexName) { if (navigator.appName.indexOf("Microsoft") != -1 || navigator.appName.indexOf("MSIE") != -1) { return window[flexName]; } else { return document.getElementById(flexName); } } function shutdownHook(){ window.alert ("are you sure ?"); thisFlexApp("MyFlexApp").flexShutdownHandler(); } //Set up notification for flex app when page unloads window.onbeforeunload = shutdownHook; &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload