Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
One of the most common tasks with ActionScript code is to add a hyperlink to a web page. In previous versions of Flash, this required typing a lot of code. In Flash CS5, it's really easy with the Code Snippets panel. You can add a link to a movie clip or button symbol. On the Stage, I have an instance of a button symbol. I prefer using button symbols over movie clips, because Flash automatically uses the hand cursor when you roll over a button symbol and that doesn't happen with a movie clip. So go to the first frame where your button appears, because if you go to a later frame, the interactivity won't happen until the playhead gets to that frame.
So you want to go to the first frame where your button appears and then select the button and open up the Code Snippets panel. In the Code Snippets panel, just double-click Click to Go to Web Page, which is inside of the Actions folder. So when you click this, you will see the message that the selected symbol requires an instance name. That's a name for an instance, which is placed in the text field at the top of the Properties panel. Since Flash is going to do this work for us anyway, I am just going to click OK. So in here, you will see that Flash writes the code for you.
In the commented area, you can read information about this ActionScript. In the Instructions area, you will see that you need to replace the URL, which by default goes to adobe.com, with the desired URL address. It also mentions to keep the quotation marks. So let's scroll down in our code and make the change. By default, text in ActionScript is green, so look for green text and change that URL to explorecalifornia.org. I am just going to change it after the www and the dot, so explorecalifornia.org.
And that's it. So just test this movie in the Flash Player and you can click on the button and see the website launch. So to add a link to a button in Flash, just select the button and then apply the Go to Web Page code snippet through the Code Snippets panel.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.