zoukankan      html  css  js  c++  java
  • Styling Alert controls in Flex using the StyleManager class and setStyle() methods

    The following example shows how you can style a Flex Alert control using the static StyleManager.getStyleDeclaration() method, and the setStyle() method
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="middle"
            backgroundColor
    ="white"
            creationComplete
    ="init();">

        
    <mx:Script>
            
    <![CDATA[
                import mx.controls.Alert;
                import mx.styles.StyleManager;

                private var alert:Alert;
                private var alertCSS:CSSStyleDeclaration;

                private function init():void {
                    alertCSS = StyleManager.getStyleDeclaration("Alert");
                }

                private function showAlert(color:Object):void {
                    alertCSS.setStyle("modalTransparencyColor", color);
                    alertCSS.setStyle("themeColor", color);
                    alert = Alert.show("The quick brown fox");
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:ApplicationControlBar dock="true">
            
    <mx:Button label="Red"
                    themeColor
    ="red"
                    click
    ="showAlert('red');" />
            
    <mx:Button label="Orange"
                    themeColor
    ="haloOrange"
                    click
    ="showAlert('haloOrange');" />
            
    <mx:Button label="Yellow"
                    themeColor
    ="yellow"
                    click
    ="showAlert('yellow');" />
            
    <mx:Button label="Green"
                    themeColor
    ="haloGreen"
                    click
    ="showAlert('haloGreen');" />
            
    <mx:Button label="Blue"
                    themeColor
    ="haloBlue"
                    click
    ="showAlert('haloBlue');" />
        
    </mx:ApplicationControlBar>

    </mx:Application>

  • 相关阅读:
    由button标签在 IE 8.0 下的异常表现引发的一场血案
    【javascript】—— JS判断浏览器类型、操作系统
    【javascrpt】——图片预览和上传,兼容IE 9-
    YII安装smarty-view-renderer扩展
    Yii中用递归方法实现无限级分类
    Yii中Ajax的使用,如收藏功能
    Javascript and AJAX with Yii(在yii 中使用 javascript 和ajax)
    Yii框架zii.widgets.grid自定义按钮,ajax触发事件并提示
    yii 中设置提示成功信息,错误提示信息,警告信息
    Yii Framework 开发教程Zii组件-Tabs示例
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1089910.html
Copyright © 2011-2022 走看看