ie9 ....关闭窗口,运行flex功能

时间:2010-09-18 20:30:24

标签: javascript flex internet-explorer

我有Flex 4&亚马逊付款按钮,Miti在这里显示的方式: http://miti.pricope.com/2009/07/11/using-amazon-flexible-payment-system-with-flex/

正如他所示,当付款过程完成后,弹出窗口中会出现一个调用JavaScript函数的html按钮。这个JavaScript函数将关闭弹出窗口,返回主Flex应用程序&在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>   

` 这在chrome,firefox和&amp ;; IE8。但是,它在新的ie9中不起作用。 html按钮在那里,但点击它什么都不做:不关闭弹出窗口也不在flex中运行该功能。有没有人有解决方法?

编辑:我可以得到“window.close();”部分工作正常。但是,在闪存中调用该函数仍然无法正常工作。

1 个答案:

答案 0 :(得分:0)

说明getElementById('index')索引是您的Flash应用程序的ID。 你也应该这样:

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

from,正确地调用你的东西。并验证您是否在应用程序中添加了回调。

无论如何,这是一个ExternalInterface类型的问题,所以更多的例子请看这里:http://blog.flexexamples.com/category/externalinterface/