PDA

View Full Version : URL in AS3



vikrant29nov
April 15th, 2009, 07:51 AM
I am using below code for URL in AS3 but its not running in browser i.e., when I click on the button it is not opening http://www.kirupa.com

function gotoPage(event:MouseEvent):void {
var targetURL:URLRequest=new URLRequest("http://www.kirupa.com");
navigateToURL(targetURL);
}
btn.addEventListener(MouseEvent.CLICK, gotoPage);

Please help:look:

bgflasher
April 15th, 2009, 08:20 AM
Your code is working :)

Are you sure you made a button with instance name 'btn' ?

vikrant29nov
April 16th, 2009, 07:55 AM
Your code is working :)

Are you sure you made a button with instance name 'btn' ?

:cantlook: oh noo

you are right I hav used 'bt' instead of "btn".

Thx dude. thx for the help :hugegrin: