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

flex_警告窗口自定义示例;

发布时间:2020-12-15 05:09:54 所属栏目:百科 来源:网络整理
导读:效果图: ?xml version="1.0" encoding="utf-8"? s: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" ?? ??? ??? ??? minWidt

效果图:


<?xml version="1.0" encoding="utf-8"?>

<s: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" ?? ??? ??? ??? minWidth="955" minHeight="600" pageTitle="警告窗口示例" ?? ??? ??? ??? applicationComplete="initFn()"> ?? ? ?? ?<fx:Script> ?? ??? ?<![CDATA[ ?? ??? ??? ?import mx.controls.Alert; ?? ??? ??? ?import mx.events.CloseEvent; ?? ??? ??? ? ?? ??? ??? ?// 图标: ?? ??? ??? ?[Bindable] ?? ??? ??? ?[Embed(source="src/img/jiafm.gif")] ?? ??? ??? ?protected var _iconWarning:Class; ?? ??? ??? ? ?? ??? ??? ?protected function initFn():void{ ?? ??? ??? ??? ?// 警告窗口变量: ?? ??? ??? ??? ?var alert:Alert; ?? ??? ??? ??? ? ?? ??? ??? ??? ?// 修饰警告窗口: ?? ??? ??? ??? ?Alert.buttonWidth = 80; ?? ??? ??? ??? ?Alert.okLabel = "确认"; ?? ??? ??? ??? ?Alert.yesLabel = "是的"; ?? ??? ??? ??? ?Alert.noLabel = "不是"; ?? ??? ??? ??? ?Alert.cancelLabel = "取消"; ?? ??? ??? ??? ? ?? ??? ??? ??? ?// 示例化警告窗口: ?? ??? ??? ??? ?alert = Alert.show("修饰警告窗口显示!","警告窗口示例",Alert.OK|Alert.YES|Alert.NO|Alert.CANCEL,?? ??? ??? ??? ??? ??? ??? ??? ??? ?this,onAlertClose,_iconWarning,Alert.YES); ?? ??? ??? ??? ? ?? ??? ??? ??? ?// 像操作标准弹出式窗口一样操作警告窗口; ?? ??? ??? ??? ?alert.height = 230;?? ?// 高度; ?? ??? ??? ??? ?alert.width = 450;?? ?// 宽度; ?? ??? ??? ??? ? ?? ??? ??? ??? ?// 恢复属性值: ?? ??? ??? ??? ?Alert.okLabel = "OK"; ?? ??? ??? ??? ?Alert.yesLabel = "Yes"; ?? ??? ??? ??? ?Alert.noLabel = "No"; ?? ??? ??? ??? ?Alert.cancelLabel = "Cancel"; ?? ??? ??? ?} ?? ??? ??? ? ?? ??? ??? ?protected function onAlertClose(event:CloseEvent):void{ ?? ??? ??? ??? ?trace("=>警告窗口关闭回调函数!"); ?? ??? ??? ??? ? ?? ??? ??? ??? ?switch (event.detail) { ?? ??? ??? ??? ??? ?case Alert.YES: ?? ??? ??? ??? ??? ??? ?trace(Alert.YES); ?? ??? ??? ??? ??? ??? ?break; ?? ??? ??? ??? ??? ?case Alert.NO: ?? ??? ??? ??? ??? ??? ?trace(Alert.NO); ?? ??? ??? ??? ??? ??? ?break; ?? ??? ??? ??? ??? ?case Alert.OK: ?? ??? ??? ??? ??? ??? ?trace(Alert.OK); ?? ??? ??? ??? ??? ??? ?break; ?? ??? ??? ??? ??? ?case Alert.CANCEL: ?? ??? ??? ??? ??? ??? ?trace(Alert.CANCEL); ?? ??? ??? ??? ??? ??? ?break; ?? ??? ??? ??? ?} ?? ??? ??? ?} ?? ??? ?]]> ?? ?</fx:Script>??? </s:Application>

(编辑:李大同)

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

    推荐文章
      热点阅读