as3 getURL() for as3
Code Snippet :: getURL() for as3
function getURL(url:String, windowType:String):void {
var windowTypes:Array = new Array('_blank', '_self');
if(windowTypes.indexOf(windowType) == -1){
windowType = '_blank';
}
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, windowType);
} catch (e:Error) {
trace("Error occurred! Unable to open window");
}
}
getURL("http://www.example.com/");