2010/11/02

[Flash AS3] navigateToURL 連結

import flash.net.navigateToURL

Syntax:
public function navigateToURL(request:URLRequest, window:String = null):void

request 需要使用 new URLRequest(url)
window 可用的字串: _self, _blank, _top, _parent

例:
import flash.net.URLRequest;     // 需使用 URLRequest 函式
import flash.net.navigateToURL;

btnGotoUrl.addEventListener(MouseEvent.CLICK, gotoUrl);
function gotoUrl(event:MouseEvent):void {
    navigateToURL(new URLRequest("http://devmanna.blogspot.com/"), "_blank");
}

沒有留言: