Using Components > Adding components to Flash documents > Adding a component using the Components panel |
![]() ![]() ![]() |
Adding a component using the Components panel
When you add a component to a document using the Components panel, several items for the component are added to the Library panel, inside a Flash Components UI folder. See Components in the Library panel.
After you add a component to a document using the Components panel, you can add additional instances of the component to the document by dragging the component from the Library panel to the Stage. You can set properties for additional instances in the Parameters tab of the Property inspector or in the Component Parameters panel, as described in the individual components sections in this chapter.
To add a component to a Flash document using the Components panel:
1 |
Choose Window > Components. |
2 |
Do one of the following: |
![]() |
Drag a component from the Components panel to the Stage. |
![]() |
Double-click a component in the Components panel. |
3 |
If you have edited skins for another instance of the same component, or for a component that shares skins with the component you are adding, do one of the following: |
![]() |
Choose Don't Replace Existing Items to preserve the edited skins and apply the edited skins to the new component. |
![]() |
Choose Replace Existing Items (not undoable) to replace all the skins with default skins. The new component and all previous versions of the component, or of components that share its skins, will use the default skins. |
4 |
Select the component on the Stage. |
5 |
Choose Window > Properties. |
6 |
In the Property inspector, enter an instance name for the component instance. |
7 |
Click the Parameters tab and specify parameters for the instance, as described in the individual component section in this chapter. |
8 |
Change the size and scale of the component as desired. For more information on sizing specific component types, see the individual component sections. |
9 |
Change the color and text formatting of a component as desired, by doing one or more of the following: |
![]() |
Set or change a specific property value for a component instance using the |
![]() |
Edit multiple properties in the global style format assigned to all Flash UI components. |
![]() |
If desired, create a custom style format for specific component instances. For more information, see Customizing component colors and text. |
10 |
Customize the appearance of the component if desired, by doing one of the following: |
![]() |
Edit the skins in the Component Skins folder for a component type. |
![]() |
Register new skin elements that you create to the component skins. For more information, see Customizing component skins. |
To add a component to your Flash document using ActionScript:
Note: The instructions in this section assume an intermediate or advanced knowledge of ActionScript and the Actions panel.
1 |
Select the frame in the Timeline where you want to place the component. |
2 |
Open the Actions panel in expert mode. |
3 |
Write a function to create the component instance, using the following code as a template: |
_root.attachMovie("FCheckBoxSymbol", "checkBox1", Z); _root.checkBox1.setValue(false); _root.checkBox1.setLabel("myCheckbox"); |
|
4 |
Use the ActionScript methods of the component to specify additional options or override parameters set during authoring. |
For more information on writing ActionScript for components, see Writing change handler functions for components and Creating forms using components. For detailed information on the ActionScript methods available to each component type, see entries for each component in the online ActionScript Dictionary in the Help menu. Entries in the dictionary are referenced using the format FCheckBox (component), FRadioButton (component), and so on. |
![]() ![]() ![]() |