MACROMEDIA FLEX BUILDER-USING FLEX BUILDER Use Manual page 119

Table of Contents

Advertisement

Manually inserting components
If you prefer to insert components by hand in Code view, make sure you specify the component
namespace.
To manually insert a component:
Open the parent MXML file in Code view (View > Code) and enter the component tag.
1.
For standard Flex components, you can use code hints to work faster. You can also get code
hints for custom components if you package them locally or synchronize them from the server.
For more information, see
and
"Synchronizing with custom components on the server" on page
For custom components, the tag name and case must be identical to the name and case of the
component's MXML file (see
if the component's MXML file is called LoginForm.mxml, then the component tag's name and
case is
<LoginForm...>
The following is an example of a custom component tag:
<xyz:LoginForm/>
where
is the tag prefix used to reference components in a specified namespace (for more
xyz
information, see the next step).
Specify the namespace of the component.
2.
Namespaces describe the location of component files on the Flex server. You must specify the
namespace so that your application knows where to look for the file. For more information, see
"Specifying component namespaces in your code" on page
Flex Builder will automatically specify the namespace if you package the component locally or
synchronize it from the server.
Save the file.
3.
Specifying component namespaces in your code
If you insert a component in an MXML file manually, you need to specify the component's
namespace. Namespaces describe the location of component files on the Flex server so that your
application knows where to look for the files.
You specify the namespace with the
<mx:Application>
"Including the component's properties in code hints" on page 124
"Creating MXML component files" on page
. If you enter
<loginForm...>
xmlns
tag or the custom component tag.
, the compiler will generate an error.
119.
(for "XML namespace") property of either the
Inserting controls and containers in an MXML file
125.
121). For example,
119

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex builder

Table of Contents