2010-09-18 124 views
1

我的Flex 4 &亞馬遜付款按鈕,一路米蒂所示的是: http://miti.pricope.com/2009/07/11/using-amazon-flexible-payment-system-with-flex/IE9 ....關閉窗口,運行Flex功能

正如他表示,當支付過程完成後有一個html出現在調用JavaScript函數的彈出窗口中的按鈕。此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> 

` 這鉻工作正常,火狐,& IE8。但是,它在新的ie9中不起作用。 html按鈕在那裏,但點擊它不會做任何事情:不會關閉彈出窗口,也不會在flex中運行該函數。有沒有人有解決方法?

編輯:我可以得到「window.close();」部分工作正常。但是,在Flash中調用該函數仍然不起作用。

回答

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/