- 浏览: 288238 次
- 性别:
- 来自: 广州
-
文章分类
最新评论
-
zlbdexiaohao:
book那个例子,我怎么获得osbn号
flex xml操作 -
mysh:
ui.localToGlobal(new Point(0, 0 ...
flex 组件绝对位置 -
hje:
http://help.adobe.com/en_US/Fla ...
杂记。 -
dbmonths:
dbmonths 写道dbmonths 写道brightACE ...
byteArray 操作 -
dbmonths:
dbmonths 写道brightACE 写道学习了,感谢分享 ...
byteArray 操作
<mx:Canvel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="578" height="352"
title="Alert Control Example">
<mx:Script>
<![CDATA[
import mx.events.CloseEvent;
import mx.controls.Alert;
/**
* Alert.show(message[, title[, flags[, parent[, clickHandler[, icon[, defaultButton]]]]]])
*
* message 要显示的消息。
* title: Alert 标题栏中的文本。此参数可选;如果省略此参数,则标题栏为空。
* flags: 可选参数,指示要显示在 Alert 窗口中的按钮。默认值为 Alert.OK,它将显示"确定"按钮。
* 在使用多个值时,请用 | 字符分隔各个值。
* 使用以下值中的一个或多个:Alert.OK、Alert.CANCEL、Alert.YES、Alert.NO。
* 您还可以使用 Alert.NONMODAL 指明 Alert 窗口为非模式窗口。非模式窗口允许用户与应用程序中的其它窗口交互。
*
* parent: Alert 组件的父窗口。Alert 窗口会将自己置于父窗口的中心。
* 使用值 null 或 undefined 来指定 _root 时间轴。
* 父窗口必须是 UIComponent 类的子类,并且是作为 UIComponent 的子类的另一个 Flash 组件,
* 或者是作为 UIComponent 的子类的自定义窗口
*
* clickHandler: 单击按钮时广播的 click 事件的处理函数。
* 除了标准的 click 事件对象属性外,还有另一个 detail 属性,
* 该属性包含所单击按钮的标志值(Alert.OK、Alert.CANCEL、Alert.YES、Alert.NO)。
* 此处理函数可以是函数或对象。
*
* icon: 表示要用作图标(显示在警告文本的左边)的库元件的链接标识符的字符串。此参数是可选的。
*
*defaultButton: 弹出时默认选中按钮
* 此参数可以是以下值之一:Alert.OK、Alert.CANCEL、Alert.YES、Alert.NO。
*
* 再高级的应用请自定义,采用继承
*/
private function clickSecond():void{
Alert.buttonWidth = 100;
//这样设置了标签会替换掉默认的文本
Alert.yesLabel="You"
Alert.noLabel="Default onfouce Me";
Alert.show("Are you Sure?","Note",3,this,handler,null,Alert.NO);
}
private function handler(evt:CloseEvent):void{
if(evt.detail==Alert.YES)
txtArea.text="Yes";
else
txtArea.text="No";
}
private function clickThrid():void{
Alert.buttonWidth = 100;
Alert.yesLabel = "YesLable";
Alert.noLabel = "NoLable";
Alert.cancelLabel = "CancelLable";
Alert.okLabel="okLable";
Alert.show("Select a color:","Color Selection",1|2|4|8,this,alertHandler,null);
}
private function alertHandler(event:CloseEvent):void{
switch(event.detail){
case Alert.YES:txtArea.text="Alert.YES-->detail:"+event.detail.toString();break;
case Alert.NO:txtArea.text="Alert.NO-->detail:"+event.detail.toString();break;
case Alert.CANCEL:txtArea.text="Alert.CANCEL-->detail:"+event.detail.toString();break;
case Alert.OK:txtArea.text="Alert.OK-->detail:"+event.detail.toString();break;
default:
txtArea.text="null";
}
}
//Embed 嵌入一张图片的路径
[Embed(source="VisualComponents/icons/BROWSERHINT.png")]
private var iconClass:Class;
private function clickFourth(event:Event):void{
Alert.show("Have a Icom","icon",1,this,null,iconClass,1);
}
]]>
</mx:Script>
<mx:Button x="77" y="30" label="Hello"
click="Alert.show('Hello,NONMODAL','Message',Alert.NONMODAL|2);"/>
<mx:Button x="77" y="94" label="Yes Or No"
click="clickSecond()"/>
<mx:Button x="77" y="148" label="Have Four Button Alert"
click="clickThrid()"/>
<mx:Button x="77" y="207" label="Have a Icon Alert"
click="clickFourth(event)" width="187"/>
<mx:TextArea id="txtArea" x="328" y="118" height="84"/>
</mx:Canvel >
2,alert样式:(放入CSS文件里面)
Alert
{
roundedBottomCorners: false;
borderColor: #6C6D58;
borderThicknessLeft: 1;
borderThicknessTop: 1;
borderThicknessRight: 1;
borderThicknessBottom: 1;
backgroundColor: #28C785;
titleStyleName: alertTitle;
font-size:12;
controlBarStyleName: alertControlBar;
buttonStyleName:alertBtn;
}
.alertTitle
{
color: #9D2828;
}
.alertBtn
{
height:35;
upSkin: Embed(skinClass="ButtonUp");
overSkin: Embed(skinClass="ButtonOver");
downSkin: Embed(skinClass="ButtonDown");
disabledSkin: Embed(skinClass="ButtonDis");
selectedUpSkin: Embed(skinClass="ButtonOver");
selectedOverSkin: Embed(skinClass="ButtonOver");
selectedDownSkin: Embed(skinClass="ButtonDown");
selectedDisabledSkin: Embed(skinClass="ButtonDis");
textRollOverColor: #38FF94;
textSelectedColor: #38FF94;
color: #14FF83;
}
.alertControlBar
{
}
title="Alert Control Example">
<mx:Script>
<![CDATA[
import mx.events.CloseEvent;
import mx.controls.Alert;
/**
* Alert.show(message[, title[, flags[, parent[, clickHandler[, icon[, defaultButton]]]]]])
*
* message 要显示的消息。
* title: Alert 标题栏中的文本。此参数可选;如果省略此参数,则标题栏为空。
* flags: 可选参数,指示要显示在 Alert 窗口中的按钮。默认值为 Alert.OK,它将显示"确定"按钮。
* 在使用多个值时,请用 | 字符分隔各个值。
* 使用以下值中的一个或多个:Alert.OK、Alert.CANCEL、Alert.YES、Alert.NO。
* 您还可以使用 Alert.NONMODAL 指明 Alert 窗口为非模式窗口。非模式窗口允许用户与应用程序中的其它窗口交互。
*
* parent: Alert 组件的父窗口。Alert 窗口会将自己置于父窗口的中心。
* 使用值 null 或 undefined 来指定 _root 时间轴。
* 父窗口必须是 UIComponent 类的子类,并且是作为 UIComponent 的子类的另一个 Flash 组件,
* 或者是作为 UIComponent 的子类的自定义窗口
*
* clickHandler: 单击按钮时广播的 click 事件的处理函数。
* 除了标准的 click 事件对象属性外,还有另一个 detail 属性,
* 该属性包含所单击按钮的标志值(Alert.OK、Alert.CANCEL、Alert.YES、Alert.NO)。
* 此处理函数可以是函数或对象。
*
* icon: 表示要用作图标(显示在警告文本的左边)的库元件的链接标识符的字符串。此参数是可选的。
*
*defaultButton: 弹出时默认选中按钮
* 此参数可以是以下值之一:Alert.OK、Alert.CANCEL、Alert.YES、Alert.NO。
*
* 再高级的应用请自定义,采用继承
*/
private function clickSecond():void{
Alert.buttonWidth = 100;
//这样设置了标签会替换掉默认的文本
Alert.yesLabel="You"
Alert.noLabel="Default onfouce Me";
Alert.show("Are you Sure?","Note",3,this,handler,null,Alert.NO);
}
private function handler(evt:CloseEvent):void{
if(evt.detail==Alert.YES)
txtArea.text="Yes";
else
txtArea.text="No";
}
private function clickThrid():void{
Alert.buttonWidth = 100;
Alert.yesLabel = "YesLable";
Alert.noLabel = "NoLable";
Alert.cancelLabel = "CancelLable";
Alert.okLabel="okLable";
Alert.show("Select a color:","Color Selection",1|2|4|8,this,alertHandler,null);
}
private function alertHandler(event:CloseEvent):void{
switch(event.detail){
case Alert.YES:txtArea.text="Alert.YES-->detail:"+event.detail.toString();break;
case Alert.NO:txtArea.text="Alert.NO-->detail:"+event.detail.toString();break;
case Alert.CANCEL:txtArea.text="Alert.CANCEL-->detail:"+event.detail.toString();break;
case Alert.OK:txtArea.text="Alert.OK-->detail:"+event.detail.toString();break;
default:
txtArea.text="null";
}
}
//Embed 嵌入一张图片的路径
[Embed(source="VisualComponents/icons/BROWSERHINT.png")]
private var iconClass:Class;
private function clickFourth(event:Event):void{
Alert.show("Have a Icom","icon",1,this,null,iconClass,1);
}
]]>
</mx:Script>
<mx:Button x="77" y="30" label="Hello"
click="Alert.show('Hello,NONMODAL','Message',Alert.NONMODAL|2);"/>
<mx:Button x="77" y="94" label="Yes Or No"
click="clickSecond()"/>
<mx:Button x="77" y="148" label="Have Four Button Alert"
click="clickThrid()"/>
<mx:Button x="77" y="207" label="Have a Icon Alert"
click="clickFourth(event)" width="187"/>
<mx:TextArea id="txtArea" x="328" y="118" height="84"/>
</mx:Canvel >
2,alert样式:(放入CSS文件里面)
Alert
{
roundedBottomCorners: false;
borderColor: #6C6D58;
borderThicknessLeft: 1;
borderThicknessTop: 1;
borderThicknessRight: 1;
borderThicknessBottom: 1;
backgroundColor: #28C785;
titleStyleName: alertTitle;
font-size:12;
controlBarStyleName: alertControlBar;
buttonStyleName:alertBtn;
}
.alertTitle
{
color: #9D2828;
}
.alertBtn
{
height:35;
upSkin: Embed(skinClass="ButtonUp");
overSkin: Embed(skinClass="ButtonOver");
downSkin: Embed(skinClass="ButtonDown");
disabledSkin: Embed(skinClass="ButtonDis");
selectedUpSkin: Embed(skinClass="ButtonOver");
selectedOverSkin: Embed(skinClass="ButtonOver");
selectedDownSkin: Embed(skinClass="ButtonDown");
selectedDisabledSkin: Embed(skinClass="ButtonDis");
textRollOverColor: #38FF94;
textSelectedColor: #38FF94;
color: #14FF83;
}
.alertControlBar
{
}
评论
2 楼
hje
2009-02-17
有个简单的方法:重新封装alert
把下面的as导入你的工程,可以达到你要的效果。
package myas
{
import flash.external.ExternalInterface;
import mx.controls.Alert;
public class CTIlog
{
public function CTIlog()
{
Alert.yesLabel="是";
Alert.noLabel="否";
}
public static function log(msg:String, title:String = null):void
{
Alert.yesLabel="是";
Alert.noLabel="否";
if(title!=null){
Alert.show(msg, title, Alert.NO | Alert.YES);
}else{
Alert.show(msg,"Log", Alert.NO | Alert.YES);
}
trace(msg);
}
/**
* Static method that pops up the Alert control. Show the information
* message to the cti user. The information must helpful to the cti user
* */
public static function info(info:String, title:String = null):void
{
Alert.yesLabel="是";
Alert.noLabel="否";
if(title!=null){
Alert.show(info,title, Alert.NO | Alert.YES);
}else{
Alert.show(info,"Info:", Alert.NO | Alert.YES);
}
trace(info);
}
/**
* Static method that pops up the Alert control. Show the debug information
* to the System developer.
* */
public static function debug(msg:String, title:String = null):void
{
Alert.yesLabel="是";
Alert.noLabel="否";
if(title!=null){
Alert.show(msg,title, Alert.NO | Alert.YES);
}else{
Alert.show(msg,"debug", Alert.NO | Alert.YES);
}
trace(msg);
}
/**
* Static method that pops up the Alert control. Show the System Error
* information that will serious disturb the System
* */
public static function error(error:String, title:String = null):void
{
if(title!=null){
Alert.show(error,title, Alert.NO | Alert.YES);
}else{
Alert.show(error,"Error", Alert.NO | Alert.YES);
}
trace(error);
}
}
}
把下面的as导入你的工程,可以达到你要的效果。
package myas
{
import flash.external.ExternalInterface;
import mx.controls.Alert;
public class CTIlog
{
public function CTIlog()
{
Alert.yesLabel="是";
Alert.noLabel="否";
}
public static function log(msg:String, title:String = null):void
{
Alert.yesLabel="是";
Alert.noLabel="否";
if(title!=null){
Alert.show(msg, title, Alert.NO | Alert.YES);
}else{
Alert.show(msg,"Log", Alert.NO | Alert.YES);
}
trace(msg);
}
/**
* Static method that pops up the Alert control. Show the information
* message to the cti user. The information must helpful to the cti user
* */
public static function info(info:String, title:String = null):void
{
Alert.yesLabel="是";
Alert.noLabel="否";
if(title!=null){
Alert.show(info,title, Alert.NO | Alert.YES);
}else{
Alert.show(info,"Info:", Alert.NO | Alert.YES);
}
trace(info);
}
/**
* Static method that pops up the Alert control. Show the debug information
* to the System developer.
* */
public static function debug(msg:String, title:String = null):void
{
Alert.yesLabel="是";
Alert.noLabel="否";
if(title!=null){
Alert.show(msg,title, Alert.NO | Alert.YES);
}else{
Alert.show(msg,"debug", Alert.NO | Alert.YES);
}
trace(msg);
}
/**
* Static method that pops up the Alert control. Show the System Error
* information that will serious disturb the System
* */
public static function error(error:String, title:String = null):void
{
if(title!=null){
Alert.show(error,title, Alert.NO | Alert.YES);
}else{
Alert.show(error,"Error", Alert.NO | Alert.YES);
}
trace(error);
}
}
}
1 楼
wuxi15932077655
2009-02-14
怎样将noLable yesLable放到css中设置alert按钮的文本
发表评论
-
The Miner – 专业Flash AS3性能分析器(profiler)入门教程
2012-12-10 20:00 1479The Miner是由加拿大的Jean-Philippe Au ... -
as3
2011-10-11 14:43 1186loaderInfo.url.replace(/\\/g,'/ ... -
卡马克 滚屏
2011-09-25 21:58 974一些卡马克滚屏算法的例子,来源于网上。 -
as3 另外滚屏
2011-09-25 13:31 1236比较直接的思路是改变背景地图bitmap对象的x和y属性。 ... -
基元数据和复杂数据区别
2011-02-23 00:48 1339基元数据类型: 存放的是实际的值,赋值之后,相当于 ... -
死亡 白屏
2010-09-28 10:09 1059var arr:Array=[ 0.33,0.33 ... -
css demo
2010-09-10 12:34 1046/* CSS file */ /* Global { col ... -
css
2010-09-06 17:15 792Re:FLEX3中应用CSS完全详 ... -
flex mmorpg 地图编辑器demo
2010-07-16 15:04 1216简单的demo。。只实现基本功能。代码很少。。完整程序还在做。 ... -
as 的textField
2010-05-22 11:47 1555【关于TextField以垂直方 ... -
画图(扇形)
2010-03-24 14:30 1243private function init():void ... -
flex 封包
2010-02-24 14:43 1191接触了一段时间的网游 ... -
byteArray 操作
2010-02-24 11:37 2903这段时间在做socket, 当然就用到ByteArray了,O ... -
flex 生成swc
2010-02-21 15:08 2700flexbuilder打包swc地址: http://blog ... -
flex 嵌入html
2010-02-06 16:35 966public static function getHtmlF ... -
自己写的架构
2010-01-08 16:23 889111111111111 -
string帮助类
2010-01-07 16:32 929package com.hacker{ ... -
flex flash 相互调用
2009-12-17 14:39 4278flex 调用flash: private function ... -
flex pv3d 有用公式
2009-07-24 09:35 1759实用公式 统领全书,我们已经有了各种运动和效果的公式。 ... -
flex pv3d test
2009-07-24 09:21 2233<?xml version="1.0" ...
相关推荐
然而,Flex 4的默认Alert组件可能无法满足所有设计和交互上的独特要求,因此自定义Alert就显得尤为重要。本文将深入探讨如何在Flex 4中实现自定义Alert,并讨论其相关知识点。 首先,了解Flex 4的基础架构是至关...
在Flex开发中,Alert控件是一种常用的用户交互组件,它用于显示简单的消息或者询问用户一些简单的问题。Alert控件在程序执行过程中通常是异步的,这意味着我们无法直接通过代码来控制它的显示和关闭。因此,有时我们...
在IT行业中,尤其是在前端开发领域,Flex Alert是一个常见的交互组件,用于向用户显示警告或确认信息。这个组件在用户界面设计中扮演着重要的角色,因为它提供了与用户进行非阻塞式交互的方式。当我们谈论"flex 自动...
本篇我们将聚焦于Flex中的Alert控件,它是Flex UI组件库中的一种常用组件,用于展示警告、确认或信息消息。 Alert控件在Flex中扮演着通知用户的重要角色。它通常以弹出对话框的形式出现,包含一个标题、一条消息和...
这里我们关注的是“flex的Alert样式设置”,这涉及到如何自定义和美化在Flex应用程序中显示的警告对话框(Alert)。 Alert对话框在Flex中是一种基本的UI组件,用于向用户展示信息、询问问题或确认操作。默认情况下...
在Flex开发中,有时我们需要创建一个警告对话框(alert.show),但希望它能在一段时间后自动关闭,而不是等待用户手动点击确定按钮。这个功能可以通过结合使用`Alert`类和`Timer`类来实现。下面我们将详细讲解如何在...
flex移动应用开发中Alert不能使用,该文件是AS3写的Alert,可以替代SDK自带的ALERT,超级好用
本教程将重点讲解Flex4中的Alert控件及其使用方法。 Alert控件是Flex中一种常见的对话框,用于向用户显示警告或确认信息。在Flex4中,Alert控件提供了一种简洁的方式,通过它可以弹出包含消息、标题和可选按钮的...
10. **自定义Alert窗口位置**:在Flex中,可以通过自定义皮肤和布局来改变Alert对话框的显示位置,以满足特定的界面设计需求。 11. **Flex程序发布**:发布Flex应用涉及到编译、打包和部署的流程,可能涵盖SWF的...
flex实现Mac系统下滑式Alert窗口
" click="alert('Hello, World!')"/> ``` 这里`click`属性指定了按钮被点击时执行的ActionScript函数。 ##### 2. 类和组件 Flex中的每一个UI组件都对应于一个ActionScript类。例如,`<mx:Button>`对应于`mx....
在Flex开发中,Alert消息框是一种常用的用户交互方式,它可以帮助开发者快速展示重要的信息或者请求用户的确认操作。在实际的应用场景中,为了让Alert消息框更加醒目、易于理解,通常会配合使用图标(icon)。本文将...
在Flex开发中,有时我们需要创建特定类型的用户交互界面,例如Alert对话框,它通常用于向用户提供简短的信息或确认操作。然而,默认情况下,Alert对话框是可拖动的,这在某些场景下可能不符合需求。本篇文章将深入...
在Flex应用程序中,经常需要设置Alert窗口的背景为透明,以便提高用户体验。使用`Alert { modalTransparency:0.0; modalTransparencyBlur:0; }`语句可以实现这一功能。 7. 取随机颜色 在Flex应用程序中,经常需要...
- **解释**:本章详细介绍了各种Flex组件,如Alert组件、按钮组件、分组组件、数据组件、文本组件以及布局组件,每个组件都有其独特的功能和用途。 #### 第3章:Flash Media Server 3.0 (简称FMS3) - **知识点**:...
`Alert`标签在Flex中通常用于显示简单的警告或确认对话框,与我们讨论的弹出新窗体不同。然而,如果你希望在新`Application`窗体中显示`Alert`,可以在新窗体的代码中使用`Alert.show`方法。 在提供的压缩包文件`...
Flex框架中的`Alert`类提供了显示警告框和确认对话框的功能。它可以用于向用户显示信息或请求用户做出选择。在本篇文章的代码示例中,我们主要关注的是如何根据不同的语言环境(默认为英文,中文环境)来定制这些...
alert('Hello from JavaScript! Received parameter: ' + params); } ``` 3. **配置HTML文件** 修改HTML文件(通常为`index.template.html`),确保Flex与JavaScript之间能够正确交互。 ```html <!-- ...
使用了CSS样式对Alert对话框进行了修饰;使用了样式对Accordion的Canvas上的lable字体做了修饰。 总结:对Flex和Java对象之间的转换还要进一步的研究,认识到Flex中样式的重要性。Flex的控件还要进一步学习。
alert(result); // 输出: "Hello from Flex!" } <object id="myFlexApp" data="FlexApplication.swf" width="640" height="480"> ()">Call Flex Method ``` #### 四、总结 通过以上介绍,我们可以看到`...