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

flex3.6入门学习笔记之八 Alert的3种应用

发布时间:2020-12-15 05:03:36 所属栏目:百科 来源:网络整理
导读:不明白可以给我留言 ?xml version="1.0" encoding="utf-8"? mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" ? ?mx:Script ??![CDATA[ ???import mx.controls.Alert;//添加引用提示框控件,默

不明白可以给我留言

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600"> ? ?<mx:Script> ??<![CDATA[ ???import mx.controls.Alert;//添加引用提示框控件,默认 没有 ??? ???import mx.events.CloseEvent;//调用close函数,用于对提示框的判定 ???protected function but1_clickHandler(event:MouseEvent):void ???{ ????// TODO Auto-generated method stub ????Alert.show("确定") ???} ??? ? ??? ???protected function but2_clickHandler(event:MouseEvent):void ???{ ????// TODO Auto-generated method stub ????Alert.show("?","title",3,this,alterclose)//中间数字为tag值 不同值对应不同按钮出现 3表示有确定和取消按钮 ???} ???protected function alterclose(event:CloseEvent):void ???{ ????if(event.detail==Alert.YES) ?????xz.text="true" ?????else if (event.detail==Alert.NO) ??????xz.text="false" ??????else ???????xz.text="cancel" ?????? ??? ???} ??? ???protected function Alt(event:MouseEvent):void ???{ ????// TODO Auto-generated method stub ????????????? Alert.yesLabel="true" //设置每个按钮的值 ????? Alert.noLabel="false" ?????? Alert.cancelLabel="cancel" ??????? Alert.show("?",1|2|8,alterclose)//1.2.8代表有3个按钮,比如是确定 取消 和退出 ???} ??? ???//1-?? Alert.YES ???//2-?? Alert.NO ???//3-?? Alert.YES | Alert.NO ???//4-?? Alert.OK ??//?5-?? Alert.OK | Alert.YES ???//6-?? Alert.OK | Alert.NO ???//7-?? Alert.OK | Alert.YES | Alert.NO ??//?8-?? Alert.CANCEL ???//9-?? Alert.YES | Alert.CANCEL ??//?10-?? Alert.NO | Alert.CANCEL ??//?11-?? Alert.YES | Alert.NO | Alert.CANCEL ??////?12-?? Alert.OK | Alert.CANCEL ??//?13-?? Alert.OK | Alert.YES | Alert.CANCEL ???//14-?? Alert.OK | Alert.NO | Alert.CANCEL ??//?15-?? Alert.OK | Alert.YES | Alert.NO | Alert.CANCEL ??//?16-?? Alert.OK (和4一样) ??//?17开始返回到1重新按顺序循环 ??? ??]]> ?</mx:Script> ? ?<mx:Button id="but1" x="327" y="79" label="按钮" click="but1_clickHandler(event)"/> ?<mx:Button id="but2" x="327" y="183" label="按钮" click="but2_clickHandler(event)"/> ?<mx:Label id="xz" x="327" y="242" width="166" text="标签"/> ?<mx:Button id="but3" x="327" y="309" label="按钮" click="Alt(event)"/> ? </mx:Application>

(编辑:李大同)

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

    推荐文章
      热点阅读