Skip to main content
December 20, 2007
Question

link to web page in CS3

  • December 20, 2007
  • 2 replies
  • 281 views
I have the FLASH CS3
what is the command to do to make a link from a button to a web page
this is what i have

on (release) {
getURL("www.cnn.com","_blank");
}


It is not the right one.....doesnt work and open me an error .....what is wrong here

This topic has been closed for replies.

2 replies

Participant
December 20, 2007
Okay,
first off, the script you have is AS2, and will not work if you have created an AS3 file, either you change it to AS2 in publish settings, or scrap the script and do seomething like this....

function clickHandler(event:MouseEvent):void {
var myURL:URLRequest = new URLRequest(" http://www.mysite.com/");
navigateToURL(myURL);
}

myBtn.addEventListener(MouseEvent.CLICK, clickHandler);

the instance name of your button should, in this case, would be myBtn...
You can check out the flash help, I think this is among the examples of eventlisteners

hope this helps
Participant
December 20, 2007
Okay,
first off, the script you have is AS2, and will not work if you have created an AS3 file, either you change it to AS2 in publish settings, or scrap the script and do seomething like this....

function clickHandler(event:MouseEvent):void {
var myURL:URLRequest = new URLRequest(" http://www.mysite.com/");
navigateToURL(myURL);
}

myBtn.addEventListener(MouseEvent.CLICK, clickHandler);

the instance name of your button should, in this case, would be myBtn...
You can check out the flash help, I think this is among the examples of eventlisteners

hope this helps