`
那夜温柔低调
  • 浏览: 20376 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Flex Alert 操作

    博客分类:
  • flex
阅读更多
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute">
<mx:TextArea x="10" y="32" width="436" height="253" id="t1"/>
<mx:Button x="145" y="306" label="Click" width="166" height="42" id="btn" click="alertDemo(event);"/>
<mx:Label x="10" y="6" text="验证Alert的用法:" width="226" id="l1" fontFamily="宋体" fontSize="16" color="#06D274" fontWeight="bold"/>
<fx:Script>
<![CDATA[
import flash.events.MouseEvent;

import mx.controls.Alert;
import mx.events.CloseEvent;
private function alertDemo(evt:MouseEvent):void{

Alert.okLabel="确定";

Alert.cancelLabel="取消";
Alert.show("你真的要删除吗?删除将不能回复!","删除确认",Alert.OK|Alert.CANCEL|Alert.YES,this,myClick,null,Alert.CANCEL);

}
private function myClick(evt:CloseEvent):void{
if(evt.detail==Alert.OK){
t1.text+= getTimer() + ":你点了确认按钮\n";
}
if(evt.detail==Alert.YES)
{
t1.text+= getTimer() + ":你点了YES\n";
}
if(evt.detail==Alert.CANCEL){
t1.text+= getTimer() + ":你点了取消按钮\n";
}


]]>
</fx:Script>
<fx:Style>
Alert{
messageStyleName:alertMessage;
titleStyleName:alertTitle;
buttonStyleName:alertButton;
}
.alertMessage{
fontSize:12px;
fontFamily:宋体;
color:#06D274;
fontWeight:bold;
}
.alertTitle{
fontSize:16px;
fontFamily:宋体;
color:#FF0000;
}
.alertButton{
fontSize:16px;
color:#f10c58;
/*fontFamily:宋体;*/
}
</fx:Style>
</mx:Application>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics