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.
Setting a Custom Cursor

Setting a Custom Cursor

The code snippet that you just added did not require anything to be selected before you added it, but many code snippets only work if you first select the object on stage that you wish to be affected by the code snippet.

In the next steps you will add a code snippet that will change the star_mc movie clip onstage into a custom cursor.

  1. On the Flash stage, select the star_mc clip.
  2. With the star_mc clip selected, go to the Code Snippets panel and double-click the “Custom Mouse Cursor” snippet from the Actions folder.
  3. Test the movie once more. Notice that the normal cursor icon is gone and the star_mc clip now moves with your mouse like a custom cursor.
  4. Close the codesnippets_start.swf file to leave the Flash testing environment and return to the authoring environment.
4. Setting a Source Video File | Next Section Previous Section