Macromedia flex builder-using flex builder 用户手册
118
Chapter 5: Working with Components
Visually inserting components
You can visually insert MXML components in MXML files. Flex Builder writes the appropriate
code—including the correct namespace—to reference the component. The techniques described
in this section work in both Design and Code views.
code—including the correct namespace—to reference the component. The techniques described
in this section work in both Design and Code views.
To visually insert a component:
1.
Open the parent MXML file in Code view (View > Code) or Design view (View > Design).
2.
Click inside an MXML container in the file.
Always insert components in MXML containers to lay out the components in your file. If your
file does not have any containers, select one from the Containers category of the Insert bar or
from the Insert menu. For more information, see
file does not have any containers, select one from the Containers category of the Insert bar or
from the Insert menu. For more information, see
3.
Do one of the following:
■
Click the component in the Insert bar.
■
Drag the component from the Insert bar to the page.
■
Select the component from the Insert menu.
To find a component or container in the Insert bar, position the mouse pointer over a button
and wait for a tooltip to appear.
and wait for a tooltip to appear.
Note: Custom components won’t be visible on the Insert bar until you synchronize Flex Builder
with the server. For more information, see
with the server. For more information, see
4.
If prompted by a dialog box, set or clear basic property values for the component.
A dialog box appears when you click certain components on the Insert bar. To bypass these
dialog boxes, Control-click the components on the Insert bar.
dialog boxes, Control-click the components on the Insert bar.
5.
If the component is a custom ActionScript or MXML component located in your site’s local
root folder or in any of its subfolders, select Insert > Local Component and specify the location
of the component in the Insert Local Component dialog box.
root folder or in any of its subfolders, select Insert > Local Component and specify the location
of the component in the Insert Local Component dialog box.
For more information, click the Help button on the dialog box.
Note: ActionScript components won’t render in Design view, but the code will be inserted in the
file.
file.
6.
Save the file.
Related topics
•