将 Actionscript 2 脚本转换为 AS3 等效脚本

发布于 2024-12-19 19:15:08 字数 188 浏览 3 评论 0原文

我有以下代码在 AS2 中通过单独的窗口(通过按钮操作)打开文档:

mapSym_btn.onRelease = function() {
getURL ("https://myPortal.html", "_blank")}

谁能告诉我如何在 AS3 中获得相同的结果?我将不胜感激任何帮助。

I have the following code to open a document through a separate window (through a button action) in AS2:

mapSym_btn.onRelease = function() {
getURL ("https://myPortal.html", "_blank")}

Can anyone show me how to get the same results in AS3? I'd appreciate any assistance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉鱼一梦 2024-12-26 19:15:08

(未经测试的代码)

mapSym_btn.addEventListener(MouseEvent.CLICK, goSomewhere);
function goSomewhere(evt:MouseEvent):void {
   var request:URLRequest = new URLRequest("https://myPortal.html");
   try{        
      navigateToURL(request, "_blank")
   } catch(e:Error){
      trace("Ah snap, there was a problem!");
   }
}

(untested code)

mapSym_btn.addEventListener(MouseEvent.CLICK, goSomewhere);
function goSomewhere(evt:MouseEvent):void {
   var request:URLRequest = new URLRequest("https://myPortal.html");
   try{        
      navigateToURL(request, "_blank")
   } catch(e:Error){
      trace("Ah snap, there was a problem!");
   }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文