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.
下一篇:AS3键盘控制键盘