Jump to content

{Self Solved} [Question] Action Script 3 URLRequest Target e.g. _self, _blank


1 post in this topic

Recommended Posts

ok i've got a button that has and instance name of close_btn and when i add the code to it it works until i try to specify a target

 

close_btn.addEventListener(MouseEvent.CLICK, callLink);

function callLink:void {

 var url:String = "http://site";

 var request:URLRequest = new URLRequest(url);

 try {

navigateToURL(request, '_self');

 } catch (e:Error) {

trace("Error occurred!");

 }

}

 

i'm no actionscript ninja but i can fight my way in and out but this seems like i'm way overthinking it like i tend to do

 

Thank You in advance for any help

 

 

**********************************************

 

alright i fixed it, yes i was overcomplicating it.

 

close_btn.addEventListener(MouseEvent.CLICK, callLink);
function callLink(event:MouseEvent):void {
var url:URLRequest = new URLRequest("http://www.adobe.com"); navigateToURL(url, "_self"); 
trace("You Clicked the Close button");
}

Link to comment
Share on other sites

 Share

×
×
  • Create New...