多次Autocomple

<?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>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值