<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:hc="com.hillelcoren.components.*" //导入autoComplete自动提示的包
xmlns:classes="com.hillelcoren.components.autoComplete.classes.*"
xmlns:local="*"
width="100%" height="100%" color="#000000"
verticalAlign="top" horizontalAlign="left"
paddingLeft="20" paddingTop="15" paddingBottom="20" paddingRight="20"
initialize="init()">
<mx:Script>
<![CDATA[
import mx.utils.ObjectUtil;
import mx.events.MenuEvent;
import com.hillelcoren.components.AutoComplete;
import mx.core.Application;
import mx.core.UIComponent;
import mx.collections.ArrayCollection;
import mx.resources.ResourceManager;
import mx.controls.Alert;
[Bindable]
private var Title:String;
private var locales:Array = ["en_US","zh_CN"];
[Bindable]
public var datas:ArrayCollection;
private function init():void
{
datas = new ArrayCollection(["131","132","130","Axx","Ddd cc","xxx yyy","133","134","135","136",
"137","138","139","150","158","159",
"广东 广州","Bxx Baa","上海","张三","李四","Aadla","Asf sf",
"Bxv sfs","Abort XXX","Asp Php"]);
stat.text = flash.system.Capabilities.language;//获取系统当前的语言环境
}
public function dd():void{
test.text = autoComplete.text;
}
public function internation(txt:String):void{
this.resourceManager.localeChain = [txt];
test.text = txt;
}
]]>
</mx:Script>
<mx:Metadata>
[ResourceBundle("message")]
</mx:Metadata>
<mx:HBox width="100%" minWidth="200">
<mx:Text id="test" />
<hc:AutoComplete id="autoComplete" dataProvider="{ datas }" labelField="name" matchType="anyPart"
prompt="Choose your favorite Crayola crayon" width="100%"
allowNewValues="true" selectedItemStyleName="{ AutoComplete.STYLE_UNDERLINE }" backspaceAction="focus"
allowDuplicates="true" allowMultipleSelection="true"
allowEditingNewValues="true" /> //对自动提示的一些设置
<mx:Button label="button" click="dd()"/>
</mx:HBox>
<mx:Label id="label1" x="10" y="10" text="{resourceManager.getString('message', 'label1')}" width="152" height="20" fontSize="12" fontWeight="bold"/>
<mx:RadioButton groupName="lanage" label="English" id="lanage1" value="en_US" click="internation('en_US')"/>
<mx:RadioButton groupName="lanage" label="中文" id="lanage2" value="zh_CN" click="internation('zh_CN')"/>
<mx:Label text="系统当前使用的语言:"/><mx:Text id="stat" />
</mx:Application>