Flex supplies a ComboBox control that you can use as part of a form that collects address information from a customer. In the form, you can include a ComboBox control to let the user select the state portion of the address from a list of the 50 states in the U.S. In an application that has multiple forms where a user can enter an address, it would be tedious to create and initialize multiple ComboBox controls with the same information about all 50 states.
Instead, you create an MXML component that contains a ComboBox control with all the 50 states defined within in it. Then, wherever you need to add a state selector to your application, you use your custom MXML component. The following example shows a possible definition for a custom ComboBox control:
<!-- intro\StateComboBox.mxml -->
<!-- Specify the root tag and namespace. -->
<!-- Add all other states. -->
The main application, or any other MXML component file, references the StateComboBox component, as the following example shows:
<!-- intro/IntroMyApplication.mxml -->
<!-- Include the namespace definition for your custom components. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:MyComp="*">
<!-- Use the filename as the MXML tag name. -->
Hope this will make things clear.
If this post answers your question or helps, please kindly mark it as such.
You can also use XML file to create comboboxes by putting less efforts in coding
You can use Xml file containing all the objects for combobox and render them .
It helps to change all the data anytime we want without even going to code.
@Kiran you just said hi to yourself...
Having a XML file containing all the objects is like making a DB call for the data...it's more work, and slower to instantiate than something simply all there.
If your data doesn't change then custom component is good, but if it changes you may want to look at a different method.
I am talking about a bigger and effficient way where you can put more than
1000 objects in combobox , by the way look at my username i am diffrent Kiran