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>

  • 相关阅读:
    koa2 ctx.body 在 mysql query的回调函数中无法赋值的问题
    hibernate 实现多表连接查询
    Struts2 的国际化实现
    struts2 dwr There is no Action mapped for action ... 原因及解决方案
    Hibernate4.1配置数据库连接池 org.hibernate.service.jndi.JndiException:Unable to lookup JNDI name java:comp/env...
    Android 使用JSON格式与服务器交互 中文乱码问题解决
    Struts2 访问 Servlet API 的三种方法
    Struts2 输入校验
    hibernate4 和 spring3 整合注意事项 否则java.lang.NoSuchMethodError异常
    MySQL密码忘记的解决方案
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1089910.html
Copyright © 2011-2022 走看看