Hi, Actually i have written a code for auto complete input text. So i have two file which is displayed below.
***********************************************************************************
FILE NAME: AutoComplete.mxml
***********************************************************************************
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:comp="assets.actionScript.*"
backgroundColor="0"
layout="absolute"
>
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.collections.ArrayCollection;
[Bindable]
public var countries: Array = [
{id: 0, name:"Monaco"},
{id: 1, name:"Macau"},
{id: 2, name:"Hong Kong"},
{id: 3, name:"Singapore"},
{id: 4, name:"Gibraltar"},
{id: 5, name:"Vatican City"},
{id: 6, name:"Malta"},
{id: 7, name:"Bermuda"},
{id: 8, name:"Maldives"},
{id: 9, name:"Bahrain"},
{id: 10, name:"Bangladesh"},
{id: 11, name:"Channel Islands"},
{id: 12, name:"Nauru"},
{id: 13, name:"Taiwan"},
{id: 14, name:"Barbados"},
{id: 15, name:"Palestinian territories"},
{id: 16, name:"Mauritius"},
{id: 17, name:"Aruba"},
{id: 18, name:"South Korea"},
{id: 19, name:"San Marino"},
{id: 20, name:"Puerto Rico"},
{id: 21, name:"Tuvalu"},
{id: 22, name:"Netherlands"},
{id: 23, name:"Martinique"},
{id: 24, name:"Comoros"},
{id: 25, name:"Lebanon"},
{id: 26, name:"Rwanda"},
{id: 27, name:"Marshall Islands"},
{id: 28, name:"Belgium"},
{id: 29, name:"Japan"},
{id: 30, name:"India"},
{id: 31, name:"El Salvador"},
{id: 32, name:"American Samoa"},
{id: 33, name:"U.S. Virgin Islands"},
{id: 34, name:"Sri Lanka"},
{id: 35, name:"R union"},
{id: 36, name:"Guam"},
{id: 37, name:"Haiti"},
{id: 38, name:"Saint Vincent"},
{id: 39, name:"Israel"},
{id: 40, name:"Saint Lucia"},
{id: 41, name:"Philippines"},
{id: 42, name:"Burundi"},
{id: 43, name:"Guadeloupe"},
{id: 44, name:"Grenada"},
{id: 45, name:"Trinidad and Tobago"},
{id: 46, name:"Vietnam"},
{id: 47, name:"United Kingdom"},
{id: 48, name:"Jamaica"},
{id: 49, name:"Germany"},
{id: 50, name:"Netherlands Antilles"},
];
</mx:Script>
<mx:Style>
global
{
font-family: Verdana;
font-weight: normal;
verticalGap: 0;
horizontalGap: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
}
FormHeading
{
font-size: 10;
font-weight: normal;
}
</mx:Style>
</mx:Application>
***********************************************************************************
FILE NAME: abc.mxml
***********************************************************************************
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:comp="assets.actionScript.*"
backgroundColor="0"
layout="absolute"
applicationComplete="hello(event)"
>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.collections.ArrayCollection;
[Bindable] private var data1: ArrayCollection;
[Bindable] public var autoComp:AutoComplete;
</mx:Script>
<mx:HBox
height="100%" width="100%">
<mx:Form
height="100%">
<mx:FormHeading
color="#FFFFFF"
label="B) Modified version"
/>
<mx:FormItem>
<comp:AutoCompleteModified id="acu"
width="180"
dataProvider="{autoComp.countries}"
labelField="name"
/>
</mx:FormItem>
</mx:Form>
</mx:HBox>
</mx:Application>
***********************************************************************************
Actually i crated a arraylist in AutoComplete.mxml file and i created a Hbox in one more file called abc.mxml, But here the arraylist which i created in AutoComplete.mxml file is not binding in abc.mxml(actually i want call the arraylist which is in AutoComplete.mxml file to abc.mxml)So please help me in this problem. I'm newly learning these things