Return to Snippet

Revision: 55817
at May 17, 2012 20:16 by toccoo


Updated Code
link_btn.addEventListener(MouseEvent.CLICK, callLink);

function callLink(e:MouseEvent):void {
	var url:String = LoaderInfo(this.root.loaderInfo).parameters['url'];
	//var url:String = root.url;
	var urlRequest:URLRequest = new URLRequest(url);
	navigateToURL(urlRequest);
}


//Opening a new window:
navigateToURL (new URLRequest ("http://blog.activetofocus.com"), "_blank");
//Sending an email: 
navigateToURL (new URLRequest ("mailto: [email protected]"));
//Interacting with JavaScript:
navigateToURL (new URLRequest ("javascript: window.close ()"));
//Calling a JavaScript function: 
navigateToURL (new URLRequest ("javascript: MyJsFun (par. ..)"));


//
// Lazy shorthand.  Reminder: navigateToURL SHOULD be in a try/catch
my_btn.addEventListener(MouseEvent.CLICK, myBtnClicked);
 
function myBtnClicked(e:MouseEvent):void {
    navigateToURL(new URLRequest("http://www.example.com/"));
}

Revision: 55816
at May 17, 2012 20:15 by toccoo


Updated Code
link_btn.addEventListener(MouseEvent.CLICK, callLink);

function callLink(e:MouseEvent):void {
	var url:String = LoaderInfo(this.root.loaderInfo).parameters['url'];
	//var url:String = root.url;
	var urlRequest:URLRequest = new URLRequest(url);
	navigateToURL(urlRequest);
}


//Opening a new window:
navigateToURL (new URLRequest ("http://blog.activetofocus.com"), "_blank");
//Sending an email: 
navigateToURL (new URLRequest ("mailto: [email protected]"));
//Interacting with JavaScript:
navigateToURL (new URLRequest ("javascript: window.close ()"));
//Calling a JavaScript function: 
navigateToURL (new URLRequest ("javascript: MyJsFun (par. ..)"));

Revision: 55815
at February 23, 2012 07:51 by toccoo


Initial Code
link_btn.addEventListener(MouseEvent.CLICK, callLink);

function callLink(e:MouseEvent):void {
	var url:String = LoaderInfo(this.root.loaderInfo).parameters['url'];
	//var url:String = root.url;
	var urlRequest:URLRequest = new URLRequest(url);
	navigateToURL(urlRequest);
}

Initial URL


Initial Description
Переход по ссылке. Ссылка берется извне.

Initial Title
navigateToURL for banners

Initial Tags


Initial Language
ActionScript 3