Adobe Flash Professional CS6 Adobe Flash Professional CS6 Classroom In A Book | Page 359
Using the Code snippets Panel
You can also use the Code Snippets panel to visually point and add code to load
external SWF or image files. Using the Code Snippets panel can save you time and
effort, but writing your own code by hand is the only way to understand how the
code works and will help you begin building your own more sophisticated, custom-
ized projects.
Follow these alternate steps if you wish to rely on the Code Snippets panel. However,
the remainder of this lesson will refer to the code presented in the previous section.
1 Choose Window > Code Snippets, or if your Actions panel is already open, click
the Code Snippets button at the top right of the Actions panel.
The Code Snippets panel appears. The code snippets are organized in folders
that describe their function.
2 In the Code Snippets panel, expand the folder called Load and Unload and
select Click to Load/Unload SWF or Image.
3 Click the Show code button.
The actual code appears. There is a commented portion of the code that
describes the function of the code and the different parameters. The colored
parts of the code are the parts that you need to change.
4 Move your mouse over the blue words instance_name_here.
Your mouse cursor turns into the pick whip icon that appears as a small curl.
5 Click and drag your cursor from the blue code words to the first movie clip on
the Stage.
The movie clip instance becomes highlighted with a yellow border, indicating
that the selected code snippet will be applied to it.
350
Lesson 9
Loading and Controlling Flash Content