views:

51

answers:

1

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 funtion. This javascript funtion will close the popup window, return to the main flex app & run a function in flex:

`

<script type="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.

A: 

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/

Eugene