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

flex Alert 提示使用

发布时间:2020-12-15 05:07:04 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="15"mx:Script![CDATA[import mx.events.CloseEvent;import mx.controls.Alert;private function onClick():void {Alert.show("
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
	 fontSize="15">
	<mx:Script>
		<![CDATA[
			import mx.events.CloseEvent;
			import mx.controls.Alert;
			
			private function onClick():void {
				Alert.show("Hello World!");
			}
			
			private function onClickTitle():void {
				Alert.show("Hello World!","这里是标题");
			}	
			
			private function onClickConfirm():void {
				Alert.yesLabel = "是";
				Alert.noLabel ="否";
				Alert.show("Hello World!","这里是标题",3,this,onCloseHandler);
			}	
			
			private function onCloseHandler(e:CloseEvent):void {
				if(e.detail == Alert.YES){
					alertResult.text = "你选择的是:“是”";
				} else if (e.detail == Alert.NO) {
					alertResult.text = "你选择的是:“否”";
				} else if (e.detail == Alert.CANCEL) {
					alertResult.text = "你选择的是:“取消”";
				}
			}
			
			private function onClickHandler():void {
				Alert.yesLabel = "是";
				Alert.noLabel = "否";
				Alert.cancelLabel = "取消";
				Alert.show("Hellow World!","这里是标题!",1|2|8,onCloseHandler);
				
			}
		]]>
	</mx:Script>
	
	<mx:Button label="弹出1" click="onClick()" x="77" y="62"/>
	<mx:Button label="弹出2" click="onClickTitle()" x="232" y="62"/>
	<mx:Button label="弹出3" click="onClickConfirm()" x="394" y="62"/>
	<mx:Button label="弹出4" click="onClickHandler()" x="546" y="62"/>
	<mx:Label text="结果:" x="77" y="206"/><mx:Label id="alertResult" x="211" y="206"/>
	
</mx:Application>

(编辑:李大同)

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

    推荐文章
      热点阅读