Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 81

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

Advertisement

Creating composite MXML components
A composite MXML component is a component that contains multiple component
definitions within it. To create a composite component, you specify a container as its root tag,
and then add Flex components as children of the container.
For example, the following component contains an address form created by specifying a
container as the root tag of the component, and then defining several children of the Form
container. One of the
<MyComp:StateComboBox>
on page
78:
<?xml version="1.0"?>
<!-- mxml/AddressForm.mxml -->
<mx:Form xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:MyComp="*">
<mx:FormItem label="NameField">
<mx:TextInput/>
</mx:FormItem>
<mx:FormItem label="Street">
<mx:TextInput/>
</mx:FormItem>
<mx:FormItem label="City" >
<mx:TextInput/>
</mx:FormItem>
<mx:FormItem label="State" >
<MyComp:StateComboBox/>
</mx:FormItem>
</mx:Form>
The following application file references the AddressForm component in the
tag:
<?xml version="1.0"?>
<!-- mxml/MyApplicationAddressForm.mxml-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComp="*" >
<MyComp:AddressForm/>
</mx:Application>
tags contains a reference to the
<mx:FormItem>
tag that you created in
"Creating MXML components"
About MXML components
Form
<AddressForm>
81

Advertisement

Table of Contents
loading

Table of Contents