小小菜鸟的web菜园子

web开发学习。好记性不如烂笔头。每天进步一点点!

导航

改变ALERT组件的背景色和背景透明度.

backgroundAlpha, backgroundColor, borderAlpha, 和 borderColor 样式.
示例:


代码:

 

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/12/23/customizing-the-background-alpha-and-background-color-of-the-alert-control-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white"
        creationComplete
="showAlert();">

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

            private var alert:Alert;

            private function showAlert():void {
                alert = Alert.show("The quick brown fox jumped over the lazy dog.", "title");
            }
        
]]>
    
</mx:Script>

    
<mx:Style>
        Alert {
            backgroundAlpha: 0.3;
            backgroundColor: red;
            borderAlpha: 0.3;
            borderColor: red;
            dropShadowEnabled: false;
        }
    
</mx:Style>

    
<mx:ApplicationControlBar dock="true">
        
<mx:Button label="Show alert" click="showAlert();" />
    
</mx:ApplicationControlBar>

</mx:Application>

posted on 2008-04-26 13:57  『小小菜鸟』  阅读(1557)  评论(0编辑  收藏  举报