/ Published in: ActionScript 3

Переход по ÑÑылке. СÑылка беретÑÑ Ð¸Ð·Ð²Ð½Ðµ.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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: //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/")); }
Comments
