0

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

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

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

4

1 回答 1

2

(未经测试的代码)

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!");
   }
}
于 2011-12-05T23:26:41.377 回答