About Mxml Components - Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

The main application, or any other MXML component file, references the StateComboBox
component, as the following example shows:
<?xml version="1.0"?>
<!-- mxml/MyApplication.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComp="*">
<MyComp:StateComboBox/>
</mx:Application>
In this example, the main application file includes a new namespace definition of
as part of the
xmlns:MyComp="*"
specifies the location of the MXML component. In this case, it specifies that the component
is in the same directory as the main application file or, if you are using Flex Data Services, in
the WEB-INF/flex/user-classes directory.
As a best practice, store your components in a subdirectory. For example, you can write this
file to the myComponents directory, a subdirectory of your main application directory. For
more information on the namespace, see Chapter 2, "Developing Applications in MXML," in
Flex 2 Developer's Guide.
tag. This namespace definition
<mx:Application>

About MXML components

79

Advertisement

Table of Contents
loading

Table of Contents