需要帮助AS3 navigateToURL打开新窗口

时间:2012-12-05 19:50:02

标签: actionscript-3 navigatetourl

AS3 noob在这里。我使用以下代码成功将var发送到我的php /数据库。我的问题是,当然,当我点击Flash电影中的按钮时,浏览器会导航到“http://www.mydomain.com/charity.php?id=c”网址。

    function onPressHandlerc(evt:MouseEvent):void { 
    var url:String = "http://www.mydomain.com/charity.php?id=c";
    var request:URLRequest = new URLRequest(url);
    try {
    navigateToURL(request, '_blank');
    } catch (e:Error) {
    trace("Error occurred!");
    }
    } 

如何将navigateToURL()设置为不尝试打开“_blank”窗口并以静默方式传递var?

提前感谢您的帮助!

1 个答案:

答案 0 :(得分:3)

我认为你确实想在这种情况下使用URLLoader而不是navigateToURL。如果你熟悉的话,navigateToURL与js中的window.open非常类似,你想要更像AJAX的东西我认为这是URLLoader的用武之地。

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html

http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7cfd.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7cf5

相关问题