Friday, 3 August 2012

URLRequest in AS3

Create a MovieClip and Give it an instance Name Ex: name is "mc_btn".


Actionscript 3.0 :



import flash.events.MouseEvent;

import flash.net.URLRequest;



var myURL:URLRequest = new URLRequest(" http://www.actionscriptguru.in/  ");


function btnClick(e:MouseEvent){
navigateToURL(myURL);
}
mc_btn.addEventListener(MouseEvent.CLICK,btnClick);


Actionscript 2.0 :


mc_btn.onRelease = function(){
getURL("http://flash-as-2-3.blogspot.in/","_blank");
}

No comments:

Post a Comment