FLEX入门篇--------Alert提示框和双击事件

news/2024/5/19 17:17:26 标签: flex, null, application, string, encoding, class
class="baidu_pl">
class="article_content clearfix">
class="htmledit_views">
class="blog_title">

class="" title="">Alert的参考
http://livedocs.adobe.com/class="tags" href="/tags/FLEX.html" title=flex>flex/3/langref/mx/controls/Alert.html#effectSummary
Alert.show(text, title, flags, parent, closeHandler(关闭时触发的事件));
flag : Alert.YES|Alert.NO|Alert.OK

class="" title=""> 

class="" title="">简单的alert提示框说起.
先一起来看看官方文档的介绍:
public static show(
text:String,
title:String = class="tags" href="/tags/NULL.html" title=null>null,
flags:uint = mx.controls.Alert.OK,
parent:Sprite = class="tags" href="/tags/NULL.html" title=null>null,
clickListener:Function = class="tags" href="/tags/NULL.html" title=null>null,
iconClass:Class = class="tags" href="/tags/NULL.html" title=null>null,
defaultButton:uint = mx.controls.Alert.OK) : Alert

alert提供了一个主要的方法,就是show()方法,其实中的参数都已经很明白地列出来了,下面我自己能过一个小例子,将上面的应用进去,大家也可以发挥自己的想像,动手来试试;

class="blog_content">
class="dp-highlighter">
class="bar">
class="tools"> Java代码 复制代码
    class="dp-j">
  1. <?xml version=class="class="tags" href="/tags/STRING.html" title=string>string">"1.0" class="tags" href="/tags/ENCODING.html" title=encoding>encoding=class="class="tags" href="/tags/STRING.html" title=string>string">"utf-8"?>   
  2. <mx:Application xmlns:mx=class="class="tags" href="/tags/STRING.html" title=string>string">"http://www.adobe.com/2006/mxml" layout=class="class="tags" href="/tags/STRING.html" title=string>string">"absolute" width=class="class="tags" href="/tags/STRING.html" title=string>string">"100%" height=class="class="tags" href="/tags/STRING.html" title=string>string">"100%">   
  3.     <mx:Script>   
  4.         <![CDATA[   
  5.             class="keyword">import mx.events.CloseEvent;   
  6.             class="keyword">import mx.controls.Alert;   
  7.                
  8.             [Embed(source=class="class="tags" href="/tags/STRING.html" title=string>string">"img/over.png")]   
  9.             [Bindable]   
  10.             class="keyword">private var btn:Class;   
  11.             class="keyword">private function doubleClickHandler(event:Event):class="keyword">void{   
  12.                 Alert.okLabel=class="class="tags" href="/tags/STRING.html" title=string>string">"确定";   
  13.                 Alert.cancelLabel=class="class="tags" href="/tags/STRING.html" title=string>string">"取消";   
  14.                 Alert.show(class="class="tags" href="/tags/STRING.html" title=string>string">"您双击了我",   
  15.                 class="class="tags" href="/tags/STRING.html" title=string>string">"我的提示信息",   
  16.                 Alert.OK|Alert.CANCEL,   
  17.                 class="keyword">this,   
  18.                 closeHandlerEvent,btn,Alert.OK);   
  19.                 event.currentTarget.title=class="class="tags" href="/tags/STRING.html" title=string>string">"您双击了我";   
  20.             }   
  21.                
  22.             class="keyword">private function closeHandlerEvent(event:CloseEvent):class="keyword">void{   
  23.                 class="keyword">if(event.detail==Alert.OK){   
  24.                 testLabel.text=class="class="tags" href="/tags/STRING.html" title=string>string">"您选的是OK";   
  25.                 }class="keyword">else class="keyword">if(event.detail==Alert.CANCEL){   
  26.                     testLabel.text=class="class="tags" href="/tags/STRING.html" title=string>string">"您选的是Cancel";   
  27.                 }   
  28.             }   
  29.         ]]>   
  30.     </mx:Script>   
  31.     <mx:Panel title=class="class="tags" href="/tags/STRING.html" title=string>string">"MyTest"    
  32.         textAlign=class="class="tags" href="/tags/STRING.html" title=string>string">"center"    
  33.         doubleClick=class="class="tags" href="/tags/STRING.html" title=string>string">"doubleClickHandler(event);"    
  34.         fontSize=class="class="tags" href="/tags/STRING.html" title=string>string">"13"    
  35.         doubleClickEnabled=class="class="tags" href="/tags/STRING.html" title=string>string">"true"    
  36.         verticalAlign=class="class="tags" href="/tags/STRING.html" title=string>string">"middle"    
  37.         horizontalAlign=class="class="tags" href="/tags/STRING.html" title=string>string">"center"    
  38.         paddingBottom=class="class="tags" href="/tags/STRING.html" title=string>string">"0" paddingTop=class="class="tags" href="/tags/STRING.html" title=string>string">"0" paddingLeft=class="class="tags" href="/tags/STRING.html" title=string>string">"0" paddingRight=class="class="tags" href="/tags/STRING.html" title=string>string">"0"    
  39.         width=class="class="tags" href="/tags/STRING.html" title=string>string">"100%" height=class="class="tags" href="/tags/STRING.html" title=string>string">"100%">   
  40.         <mx:Label  id=class="class="tags" href="/tags/STRING.html" title=string>string">"testLabel" text=class="class="tags" href="/tags/STRING.html" title=string>string">"TestLabel" fontWeight=class="class="tags" href="/tags/STRING.html" title=string>string">"bold" fontSize=class="class="tags" href="/tags/STRING.html" title=string>string">"24"/>   
  41.     </mx:Panel>   
  42. </mx:Application>  

http://www.niftyadmin.cn/n/1425651.html

相关文章

自定义标签的分页使用(复杂)

分页使用1。<mytag:pagingDisplay />2。<tag> <name>pagingDisplay</name> <tagclass>nm.tag.DisplayTag</tagclass> <bodycontent>empty</bodycontent> <info> A demo </info> </tag>3。package nm.ta…

Pig安装部署与实例

安装包地址&#xff1a;https://mirrors.tuna.tsinghua.edu.cn/apache/pig/ 前提&#xff1a;Hadoop安装成功 pig安装部署&#xff1a; 1.将准备好的安装包上传到虚拟机rz 2.查看是否上传成功 3.解压缩 命令&#xff1a;tar xf pig-0.13.0.tar.gz 4.将解压缩后的文件移动到…

flash

FLASH导入到库的快捷键CTRLR 矢量渐变图导入flash在flash里面填充渐变的地方&#xff1f; EPS,AI格式请用Illustrator编辑 矢量&#xff08;很好很好很好&#xff09; http://www.veeqi.com/vector/people/ http://www.zcool.com.cn/vector/ 教学 http://www.7880.com/in…

Java网络编程(java.net )

http://java.ccidnet.com/images/java/javanet/Java网络编程&#xff08;java.net &#xff09;事实上网络编程简单的理解就是两台计算机相互通讯数据而已&#xff0c;Java SDK 提供一些相对简单的Api来完成这些工作。Socket就是其中之一&#xff0c;这些Api 存在与java.net …

hive实验

利用Hive对某网站的用户数据进行分析。 1.创建dblab数据库 命令&#xff1a;create database dblab; 2. 在dblab数据库下创建bigdata_user表&#xff0c;该表中的各种属性如下&#xff1a; 字段名 类型 id int uid string item_id string behavior_type …

zookeeper安装部署与使用

Zookeeper安装部署 安装包下载地址&#xff1a;https://apache.org/dist/zookeeper/ 1.下载安装包然后上传到主节点rz&#xff0c;centos上可使用 wget 地址 2.解压缩&#xff1a;tar xf 安装包 3.移动到/opt目录下mv zookeeper-3.4.12 /opt 4.修改目录权限 命令&#xff…

十进制十六进制转换

以321为例&#xff1a;先记住1、16、256、4096这几个数字&#xff0c;即16的平方、16的立方等等。 321/256 1 余 65 》写下1 65/16 4 余 1 》写下14 1/1 1 余 0 》写下141 即十进制321等于十六进制141 1.比如&#xff1a;216是16进制&#xff0c;转10进制: &#xff1d;2*…

ubuntu连接xshell出现的问题

使用Ubuntu连接xshell的时候出现以下问题&#xff1a; 解决方法&#xff1a; 在ubuntu的管理员用户下&#xff0c;安装openssh-server&#xff08;不是管理员在命令前使用sudo&#xff09; 安装成功后&#xff0c;查看是否有启动ssh,使用ps -e | grep ssh查看&#xff0c;如果…