是否覺得AS3.0 要超連結每次都要寫 flash.net.navigateToURL(new URLRequest("xxxx"),"_blank"); 或是要寫個開啟popup視窗的功能 還要再寫JavaScript 想要抓取網址後方的變數,也是需要加寫JavaScript 奶老師將功能包裝成Class檔,方便呼叫。 要使用時。 <br />import com.milkmidi.method.NetUtil;<br />//匯入類別。<br />for (var i:int = 0; i<5; i++) {<br /> var _mc:MovieClip = this.getChildByName("btn" + i) as MovieClip;<br /> _mc.buttonMode = true;<br /> _mc.addEventListener(MouseEvent.CLICK, onClick , false ,0 , true);<br />}<br />function onClick(e:MouseEvent):void {<br /> var _targetMC:MovieClip = e.currentTarget as MovieClip;<br /> if (_targetMC == btn0) {<br /> NetUtil.getURL("http://milkmidi.com","_blank");<br />//超連結<br /> } 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&q