Home / Articles / Adobe Flash / An Introduction to Using Code Snippets in Flash CS5

An Introduction to Using Code Snippets in Flash CS5

Article Description

Chris Florio, contributor to ActionScript 3.0 for Flash Professional CS5 Classroom in a Book, introduces the new Code Snippets feature in Flash CS5. This article shows how to add rich interactivity to Flash projects without writing any code, as well as how to modify the code snippets that Flash creates to customize your interactivity without a mastery of programming syntax.
Linking to a URL

Linking to a URL

In the final steps, you will add a code snippet that will create a link to a URL when the onstage text field is clicked.

  1. On the Flash stage, select the text field that reads “Go to URL.”
  2. With the text field selected, go to the Code Snippets panel and double-click the “Click to Go to Web Page” snippet in the Actions folder.
  3. Test the movie. Click on the text field. Your default browser should open and navigate to Adobe.com (the URL indicated in the code snippet). You can easily modify the code snippet to go to any URL you like by following the instructions in the comments that the code snippet created.

If you have any problems with any steps of this exercise, you can examine the codesnippets_complete.fla file to see a finished working version of the exercise.

8. Next Steps | Next Section Previous Section