Posts tagged url button
Create a URL button in flash AS3
0If you need a banner to have a button that when clicked takes you to another webpage when you click the flash button this is how you do it. You need to create a button (in this case a transparent rectangle on top of a web banner animation), add an event listener(a mouse event/click) and create a function (in this case the function is to request a URL and navigate to it).
1/ Press F8 to convert a rectangle into a symbol, create button and name it myButton.
2/ Click on the button in the main timeline and press F9 to open the actions window.
3/ Use this code to create an event listener and a function for after the click event.
You can use…
“_blank” or “top” to open in a new tab
“_parent” or “_self” open in the same tab
myButton.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http://www.pmlmedia.co.uk");
navigateToURL(request, "_self");
}
