是否覺得AS3.0 要超連結每次都要寫 flash.net.navigateToURL(new URLRequest("xxxx"),"_blank"); 或是要寫個開啟popup視窗的功能 還要再寫JavaScript 想要抓取網址後方的變數,也是需要加寫JavaScript 奶老師將功能包裝成Class檔,方便呼叫。 要使用時。 import com.milkmidi.method.NetUtil; //匯入類別。 for (var i:int = 0; i var _mc:MovieClip = this.getChildByName("btn" + i) as MovieClip; _mc.buttonMode = true; _mc.addEventListener(MouseEvent.CLICK, onClick , false ,0 , true); } function onClick(e:MouseEvent):void { var _targetMC:MovieClip = e.currentTarget as MovieClip; if (_targetMC == btn0) { NetUtil.getURL("http://milkmidi.com","_blank"); //超連結 } else if (_targetMC == btn1) { NetUtil.popup("http://www.google.com","milkmidi","width=400,height=300,menubar=yes,fullscreen=no,toolbar=no,status=yes,resizable=yes, titlebar=no ,scrollbars=yes"); //開啟popup } else if (_targetMC == btn2) { NetUtil.explorerAlert("hello world"); //呼叫Browser的Alert } else if (_targetMC == btn3) { NetU...