Flex中如何通过fillColors和fillAlphas样式改变Button的填充透明度以及背景填充颜色的例子

By Minidxer | January 25, 2009

接下来的例子演示了Flex中如何通过fillColors和fillAlphas样式,改变Button的填充透明度以及背景填充颜色。

让我们先来看一下Demo可以右键View Source或点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.         layout="vertical"
  4.         verticalAlign="middle"
  5.         backgroundColor="white">
  6.  
  7.     <mx:Button id="button2"
  8.             label="2 fill colors defined"
  9.             fillColors="[red, haloOrange]" />
  10.  
  11.     <mx:Button id="button4"
  12.             label="4 fill colors defined"
  13.             fillColors="[red, haloOrange, haloGreen, haloBlue]" />
  14.  
  15.     <mx:Button id="buttonSolid"
  16.             label="solid fill"
  17.             fillColors="[red, red]" />
  18.  
  19.     <mx:Button id="buttonSolidOpaque"
  20.             label="solid opaque fill"
  21.             fillAlphas="[1.0, 1.0]"
  22.             fillColors="[red, red]" />
  23.  
  24. </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Button | No Comments » | 1,547 views Tags: , ,

Search Posts