PlanetBruce Blog

Flash Components - Tips for Inspectable Metadata for Color and Font Name types
For a good introduction to creating your own Flash Components, see Creating Components with Flash MX 2004 by Joey Lott. He describes the metadata tags for specifying parameters that can be set via the Properties panel. The Adobe (formerly Macromedia) Live Docs on Adding Component Metadata aren't very thorough.

The examples are clear enough for simple datatypes, such as Numbers and Strings. Here are two other data types of interest.

For Color values, set the type=Color, and be sure to specify the RGB hex defaultValue in quotes with a preceding number sign as shown here:

  [Inspectable(defaultValue="#00ffff",type=Color)]
If you do it right, for that parameter, the user should see a bar of color in the Parameters pane of the Properties panel. Clicking on the color bar should bring up a color inspector.

For Font Names, set the type="Font Name", and be sure to include the quotes and the space as shown here:
	
  [Inspectable(defaultValue="Verdana",type="Font Name")]
If you do it right, for that parameter, if he/she tries to edit the parameter, the user should be shown a list of available fonts.



posted on Mon, 19 Mar 2007 at 11:26 | path: /multimedia | perma link