URL不自我窗口浏览窗口、自我、URL

2023-09-08 14:37:51 作者:彼岸花の殇

clickMeh.addEventListener(MouseEvent.CLICK,goThere);
function goThere(e:MouseEvent)
{
    var url:String = "http://www.mysite.com/";
    var request:URLRequest = new URLRequest(url);
    navigateToURL(request,'_self');
}

我有这个code,但每次我按一下按钮我得到新的选项卡中打开,就像是_blank指令。

i have this code but each time i click the button i'm getting new tab opened like it was "_blank" directive.

推荐答案

复制我的评论作出回答了这个问题:

Duplicating my comment to make the question answered:

尝试 _top _parent ,还有引用说:

您无法导航特殊窗口_self,_top或_parent如果您的SWF文件包含由已设置allowScriptAccess为无,或为sameDomain时域的HTML页面HTML文件和SWF文件不匹配。

You cannot navigate the special windows "_self", "_top", or "_parent" if your SWF file is contained by an HTML page that has set the allowScriptAccess to "none", or to "sameDomain" when the domains of the HTML file and the SWF file do not match.