Creating a Custom Icon

Custom icons give you the ability to engrave your logo or your company's logo into all of your components. The icons become visible in the library, replacing the default block pyramid icon. Figure 11.7 shows how custom icons appear in the library.

Figure 11.7: A custom icon replaces the default for the component.

To create the custom icon, follow these steps:

  1. Use your favorite graphics program to create a bitmap image 25 pixels by 20 pixels with a white or transparent background. The actual graphic for the icon can occupy only an area of the picture 18 pixels by 18 pixels, and you must place it on the right side of the picture so that there is a 1-pixel buffer space between the graphics and the edge of the image. For example, the icon made for the RandomSquares component looks like Figure 11.8 when zoomed in Microsoft Paint.

    Figure 11.8: Be careful when positioning the graphic of the icon within the bitmap image.

  2. Once you have created the icon, save it as a bitmap file.

  3. Import the picture into Flash. To associate the icon with the component, create a folder named FCustomIcons in the same directory as the component, and move the bitmap to the folder.

  4. Give the bitmap symbol in the library the exact same name as the component. To ensure that the two symbols have the same name, double-click the name of the component symbol, copy its value, and paste it into the name of the bitmap symbol.

  5. Edit the component by double-clicking its symbol in the library. You must place the bitmap in the component to fully associate the image with the component. Take care to keep the icon from becoming visible to the user. You can do this by creating a new layer named Custom Icon, placing the icon in the layer, and making the layer a guide layer.

At this point, if you were to close the library, go back to the main Timeline, and reopen the library, you should see the icon in place of the default. If it does not happen right away, you may have to close and reopen Flash MX. The steps to add a custom icon are very short and easy; you just have to take extreme care when you create the graphic.

The Hidden Power of Flash Components
The Hidden Power of Flash Components
ISBN: 0782142109
EAN: 2147483647
Year: 2002
Pages: 111 © 2008-2017.
If you may any questions please contact us: