Macromedia flex builder-using flex builder User Manual

Page of 158
Creating MXML component files
123
6.
If the Flex server is running on a remote computer, copy the component file to the application 
folder on the server.
Make sure the application folder structure on the server matches the folder structure on your 
local computer, and that you copy the file to the same folder on the server. The folder structure 
on the server determines the component’s namespace. For more information, see 
.
If you specified a remote folder when you defined your site in Flex Builder, you can use the Put 
command (Site > Put) to upload the file to the server. The Put command recreates the local 
folder structure on the server if it doesn’t exist.
If you want to share the component across applications and teams, you can move the file to the 
/WEB-INF/flex/user_classes folder. The /WEB-INF/flex/user_classes folder is created in your 
site’s root folder on the server the first time you compile any part of your application. 
Synchronize Flex Builder with the server (Site > Update Flex Components) so that you can use 
the Insert bar to insert the components in your files or the Tag inspector to edit their 
properties. For more information, see 
Creating and immediately using a component
You can create a custom component file and immediately insert it in an MXML file.
To create a new component file and immediately insert it in an MXML file:
1.
Open the parent MXML file and place the insertion point where you want to insert the new 
component.
If you’re using a newly created MXML file, make sure to save it before completing the next 
step.
2.
Select Insert > New Local Component.
The Insert New Local Component dialog box appears.
3.
Complete the dialog box and click OK.
For more information, click the Help button on the dialog box.
Flex Builder inserts a tag at the insertion point that references the new custom component. At 
the same time, it creates a new component file in the tabbed Document window. 
4.
Click the new component’s file tab in the Document window and write the code for the 
component.
5.
Save the component file.