Tutorials, extensions, and source files for ActionScript, Flash, and other Adobe products.

 

senocular.com ActionScript Library

getURL.as

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package {
	
	import flash.net.URLRequest;
	import flash.net.navigateToURL;
	
	/**
	 * getURL for ActionScript 3.0.  Similar 
	 * to getURL of ActionScript 2.0 in simplicity
	 * and ease. Errors are suppressed and traced
	 * to the output window.
	 */
	public function getURL(url:String, target:String = null){
		
		try {
			navigateToURL(new URLRequest(url), target);
		}catch(error:Error){
			trace("[getURL] "+error);
		}
		
	}
}