2010年6月20日 星期日

navigateToURL 網頁連結

ActionScript 2.0 語法如下:


btn_Test.onRelease=function{
getURL("http://daydaystudy.blogspot.com/");
}




ActionScript 3.0 語法如下:

function link (event:MouseEvent):void{
var newLink:URLRequest=new URLRequest("http://daydaystudy.blogspot.com/");
navigateToURL(newLink);
}
btn_test.addEventListener(MouseEvent.CLICK,link);




解說:

btn_Test 只是button 的名字, 可以隨意改其他名字
link 是function
newLink 是 variable

沒有留言:

張貼留言