本文介绍了需要帮助AS3 navigateToURL打开新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里AS3小白。我现在用的是下面的code到成功发送变量到我的PHP /数据库。我的问题当然是,当我点击Flash影片浏览器导航离开了http://www.mydomain.com/charity.php?id=cURL我的按钮。

AS3 noob here. I am using the following code to successfully send a var to my php/database. My problem is that, of course, when I click my button in the Flash movie the browser navigates away to the "http://www.mydomain.com/charity.php?id=c" url.

    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默默?

How do I set the navigateToURL() to not try to open a "_blank" window and just pass the var silently?

在此先感谢您的帮助!

推荐答案

嗯想到你居然想使用的URLLoader,而不是navigateToURL这种情况。 navigateToURL是真实的类似JS中对window.open如果你熟悉的,你想要的东西更像是AJAX,我认为这是其中的URLLoader的原因。

Ah think you actually want to use a URLLoader instead of navigateToURL for this case. navigateToURL is real similar to window.open in js if you're familiar, you want something more like AJAX I think which is where the URLLoader comes in.

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

这篇关于需要帮助AS3 navigateToURL打开新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 09:08