User Guide

4Contents
Chapter 3: Working with Components. . . . . . . . . . . . . . . . . . . . . .49
The Components panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Adding components to Flash documents . . . . . . . . . . . . . . . . . . . . . . . . 50
Components in the Library panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Setting component parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Sizing components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Deleting components from Flash documents . . . . . . . . . . . . . . . . . . . . . 57
Using code hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Creating custom focus navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Managing component depth in a document . . . . . . . . . . . . . . . . . . . . . . 59
Components in Live Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Using a preloader with components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
About loading components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Upgrading version 1 components to version 2 architecture. . . . . . . . . 62
Chapter 4: Handling Component Events . . . . . . . . . . . . . . . . . . . .63
Using listeners to handle events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Delegating events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
About the event object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Using the on() event handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Chapter 5: Customizing Components . . . . . . . . . . . . . . . . . . . . . . 81
Using styles to customize component color and text . . . . . . . . . . . . . . 82
About skinning components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
About themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Combining skinning and styles to customize a component . . . . . . . . .118
Chapter 6: Creating Components . . . . . . . . . . . . . . . . . . . . . . . . . 125
Component source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Overview of component structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Building your first component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Selecting a parent class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Creating a component movie clip. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Creating the ActionScript class file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Incorporating existing components within your component . . . . . . . 173
Exporting and distributing a component . . . . . . . . . . . . . . . . . . . . . . . . 182
Final steps in component development . . . . . . . . . . . . . . . . . . . . . . . . . 185