Alert控件的用法
来源:互联网 发布:荷兰豆 中国豆 知乎 编辑:程序博客网 时间:2024/06/05 09:21
<?xml version="1.0"?>
<!-- Simple example to demonstrate the Alert control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;
private function clickHandler(event:Event):void {
Alert.show("你想保存你的改变吗?", "保存改变", 3, this, alertClickHandler);
//show(text,title,flags,parent,closeHandle,iconClass,defaultButtonFlag)
//前两个参数分别指出弹出窗口的文字和标题,第三个参数代表了窗口中出现的按钮,第四个数this,表明alert弹出后居中的参照对象。
//第五个参数closeHandle是函数类型,这个函数用来捕捉用户的选择,第六个参数指出对话框中出现的图标,
//第七个参数代表对话框中默认处于被选状态的按钮,当按下回车键,该按钮的点击事件被触发
}
private function alertClickHandler(event:CloseEvent):void {
if (event.detail==Alert.YES)
status.text="You answered Yes";
else
status.text="You answered No";
}
private function secondClickHandler(event:Event):void {
Alert.buttonWidth = 100;
Alert.yesLabel = "Magenta";
Alert.noLabel = "Blue";
Alert.cancelLabel = "Green";
Alert.show("Select a color:","Color Selection",1|2|8,this);
}
]]>
</mx:Script>
<mx:Panel title="Alert Control Example" width="75%" horizontalAlign="center" paddingTop="10">
<mx:Text width="100%" color="blue" textAlign="center"
text="点这个按钮显示一个简单的window窗口."/>
<mx:Button label="Click Me" click="Alert.show('Hello World!', 'Message');"/>
<mx:Text width="100%" color="blue" textAlign="center"
text="点这个按钮显示一个可以供用户选择."/>
<mx:Button label="Click Me" click="clickHandler(event);"/>
<mx:Label id="status" fontWeight="bold"/>
<mx:Text width="100%" color="blue" textAlign="center"
text="Click the button below to display an Alert window that uses custom Button labels."/>
<mx:Button label="Click Me" click="secondClickHandler(event);"/>
</mx:Panel>
</mx:Application>
<!-- Simple example to demonstrate the Alert control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;
private function clickHandler(event:Event):void {
Alert.show("你想保存你的改变吗?", "保存改变", 3, this, alertClickHandler);
//show(text,title,flags,parent,closeHandle,iconClass,defaultButtonFlag)
//前两个参数分别指出弹出窗口的文字和标题,第三个参数代表了窗口中出现的按钮,第四个数this,表明alert弹出后居中的参照对象。
//第五个参数closeHandle是函数类型,这个函数用来捕捉用户的选择,第六个参数指出对话框中出现的图标,
//第七个参数代表对话框中默认处于被选状态的按钮,当按下回车键,该按钮的点击事件被触发
}
private function alertClickHandler(event:CloseEvent):void {
if (event.detail==Alert.YES)
status.text="You answered Yes";
else
status.text="You answered No";
}
private function secondClickHandler(event:Event):void {
Alert.buttonWidth = 100;
Alert.yesLabel = "Magenta";
Alert.noLabel = "Blue";
Alert.cancelLabel = "Green";
Alert.show("Select a color:","Color Selection",1|2|8,this);
}
]]>
</mx:Script>
<mx:Panel title="Alert Control Example" width="75%" horizontalAlign="center" paddingTop="10">
<mx:Text width="100%" color="blue" textAlign="center"
text="点这个按钮显示一个简单的window窗口."/>
<mx:Button label="Click Me" click="Alert.show('Hello World!', 'Message');"/>
<mx:Text width="100%" color="blue" textAlign="center"
text="点这个按钮显示一个可以供用户选择."/>
<mx:Button label="Click Me" click="clickHandler(event);"/>
<mx:Label id="status" fontWeight="bold"/>
<mx:Text width="100%" color="blue" textAlign="center"
text="Click the button below to display an Alert window that uses custom Button labels."/>
<mx:Button label="Click Me" click="secondClickHandler(event);"/>
</mx:Panel>
</mx:Application>
- Alert控件的用法
- alert的用法
- alert,confirm,prompt的用法
- FLEX Alert.show() 的用法
- Alert 用法
- javascript中confirm,alert,ptompt的用法
- JavaScript中confirm,alert,prompt的用法
- JavaScript中confirm,alert,prompt的用法
- JavaScript中 confirm, alert, prompt的用法
- JavaScript中confirm,alert,prompt的用法
- JavaScript中confirm,alert,prompt的用法
- JavaScript中confirm,alert,prompt的用法
- JavaScript中confirm,alert,prompt的用法
- js alert confirm prompt的用法
- JavaScript中confirm,alert,prompt的用法
- JavaScript中confirm,alert,prompt的用法
- js alert,confirm,prompt的用法
- JavaScript中confirm,alert,prompt的用法
- MSN签名求婚攻略,不赞不行!
- C# 3.0 入门系列(一)
- I'm back.
- 让我们设计一门编程语言吧(2)
- 通过Emit实现动态类生成-.NET教程,E-mail专题
- Alert控件的用法
- C# 3.0入门系列(二)
- SetWindowsHookEx函数详解
- C# 3.0入门系列(三)
- static修饰符- Core Java 学习笔记
- 数据仓库及OLAP分析
- 最近简单研究了一下ajax的推技术
- VC操作PowerPoint
- 基于角色访问控制的UML表示