开发者

ie9 .... close window, run flex function

I have Flex 4 & an Amazon payment button, the way Miti shows here: http://miti.pricope.com/2009/07/11/using-amazon-flexible-payment-system-with-flex/

As he shows, when the payment process is done there is an html button that appears in the popup that calls a JavaScript function. This JavaScript function will close the popup window, return to the main flex app & run a function in flex:

`

<script 开发者_如何学JAVAtype="text/javascript">
function closeWindow() {
    window.opener.window.document.getElementById('index').paymentNotification();
    window.close();
}
</script>

   <form>
   <input type="button" value="Click here to return" onClick="closeWindow()"/>
  </form>   

` This works fine in chrome, firefox, & ie8. However, it doesn't work in the new ie9. The html button is there, but clicking on it does nothing: doesn't close the popup window nor does it run the function in flex. Does anyone have a workaround?

Edit: I can get the "window.close();" part to work fine. However, calling the function in flash is still not working.


Clarify that getElementById('index') index is the id of your flash application. Also you should have this:

function thisMovie(movieName) {
         if (navigator.appName.indexOf("Microsoft") != -1) {
             return window[movieName];
         } else {
             return document[movieName];
         }
     }

from, to call your stuff properly. And get verified that you added a callback inside of your application.

Anyway, this is a ExternalInterface type problem, so for more examples look here: http://blog.flexexamples.com/category/externalinterface/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜