Greg's Blog

helping me remember what I figure out

Creating Links in a Flash Movie

| Comments

Something real basic but since I never did it before, here is how you mimic the <a href=”“> behaviour of a hyperlink in a Flash movie using a little bit of ActionScript:

When I do Flash work I tend to place most of ActionScript code in Layer 1 Frame 1. And in this place I set a variable called link, which will hold the URL I want to point to, like such:

link = “http://gregs.teacupinastorm.com/”;
stop();

Next I create a button and make it a symbol and assign an action to this symbol:

on (release) {
getURL(link, “_blank”);
}

The value for link is passed through when the movie starts up and as soon as you click on the button surface you?ll be taken through to the URL.