I started using ActionScript 3 for the first time today it turns out that GetURL no longer exists! But i found the following works fine.
This is a basic run through, it assumes that you already know a little about flash, I hope it helps...
- Create a button graphic and convert it into a button - if you want it to be clear i just set the Blend mode to Alpha... this seemed to work fine!
- Name the button - in this case "buttonName".
- Drop the following code into the first frame of your timeline (into either a new layer or your actions layer if you are familiar with this way of working).
buttonName.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):void
{
var request:URLRequest = new URLRequest(“http://www.urlhere.com”);
navigateToURL(request, “_blank”);
} - Change the URL and buttonName to suit and remove the target _blank line if not required.
- Test the movie.
- Done.
No comments:
Post a Comment