加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex 获取控件

发布时间:2020-12-15 03:48:54 所属栏目:百科 来源:网络整理
导读:flex开发中获取单个控件 直接写他的id即可 比如: as 源码 var username:TextInput =this.username; var userpwd:TextInput =this.userpwd; // TODO Auto-generated method stub Alert.show("用户名:"+username.text+"密码:"+userpwd.text,"登陆信息"); if(

flex开发中获取单个控件

直接写他的id即可 比如:

as 源码

var username:TextInput =this.username;
var userpwd:TextInput =this.userpwd;
// TODO Auto-generated method stub
Alert.show("用户名:"+username.text+"密码:"+userpwd.text,"登陆信息");
if(username.text==userpwd.text){
Alert.show("用户名和密码相同!","登陆信息");
}else{

Alert.show("用户名和密码不相同!","登陆信息");
}


mxml 源码

<s:Panel ?x="45" y="67" width="800" height="600" backgroundColor="#7E8A3E" title="登陆窗口" name="登陆窗口111" > <s:Label x="105" y="83" width="75" height="35" color="#C80606" fontSize="22" verticalAlign="middle"> <s:text >用户名</s:text> </s:Label> <s:TextInput x="200" y="92" id="username" name="username"/> <s:Label x="109" y="152" width="84" fontSize="22" text="密 ? ?码" /> <s:TextInput x="201" y="152" id="userpwd" displayAsPassword="true"/> <s:Button id="sub" x="105" y="239" label="登 ?陆" chromeColor="#38DE0B" ?click="sub_clickHandler(event)" fontSize="22"/> <s:Button x="259" y="235" width="79" id="zc" label="注册" chromeColor="#CCCCCC" fontSize="22"/> </s:Panel>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读