In some situations it is required to link to an external website. If your website is created mainly in Flash then linking to an external website is like this.
1. create a button or a movieclip to act as a button.
2. Give your buttton an instance name.
3. Write the actionscript code for it. It is like this. Lets say your button is named "myButton".
Set up the listener for the onclick event.
| Code: |
var url:URLRequest = new URLRequest("http://google.com");
myButton.addEventListener(MouseEvent.CLICK, myButtonClick);
function myButtonClick(event:MouseEvent):void { navigateToURL(url); } |
Check out a working example below!