flex 4 Filters
<s:RectangularDropShadow id="dropShadow" blurX="10" blurY="10" alpha="0.5"
distance="4" angle="90" color="0x000000"
left="1" top="1" right="1" bottom="1"> </s:RectangularDropShadow>
angle的角度,当它为0时,是水平向右的,当它为90度时,是竖直向下的。
下面是四种filter的例子,
<s:GlowFilter id="glow" blurX="12" blurY="12" color="#88AEF7" quality="2" strength="1"/>
<s:BlurFilter id="blur" blurX="4" blurY="4" quality="2" />
<s:DropShadowFilter id="dropShadow" alpha="0.35" blurX="6" blurY="6" distance="6" color="#000000" angle="90" />
<s:BevelFilter id="bevel" angle="45" blurX="0.5" blurY="0.5" distance="4" strength="0.7" highlightAlpha="0.7" shadowAlpha="0.7" />
<?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"
skinClass="TDFGradientBackgroundSkin"
viewSourceURL="srcview/index.html"
creationComplete="init()"> <fx:Script>
<![CDATA[ private var time:Timer;
private var count:int = 0; private function init():void{
time = new Timer(1000,0);
time.addEventListener(TimerEvent.TIMER,timeHandler);
time.start(); } private function timeHandler(ev:TimerEvent):void{
count ++;
dynamicText.text = String(count);
} private function filterHandler(ev:MouseEvent):void{
var filterArr:Array = []; blurBox.selected ? filterArr.push(blur): null;
glowBox.selected ? filterArr.push(glow): null;
shadowBox.selected? filterArr.push(dropShadow): null;
bevelBox.selected ? filterArr.push(bevel): null; textSample.filters = filterArr;
dynamicText.filters = filterArr;
}
]]>
</fx:Script> <s:layout>
<s:HorizontalLayout verticalAlign="middle" horizontalAlign="center" />
</s:layout> <fx:Declarations>
<!--filters-->
<s:GlowFilter id="glow" blurX="12" blurY="12" color="#88AEF7" quality="2" strength="1"/>
<s:BlurFilter id="blur" blurX="4" blurY="4" quality="2" />
<s:DropShadowFilter id="dropShadow" alpha="0.35" blurX="6" blurY="6" distance="6" color="#000000" angle="90" />
<s:BevelFilter id="bevel" angle="45" blurX="0.5" blurY="0.5" distance="4" strength="0.7" highlightAlpha="0.7" shadowAlpha="0.7" />
</fx:Declarations> <s:Panel title="Filters Samples"
width="600" height="100%"
color="0x000000"
borderAlpha="0.15"> <s:layout>
<s:VerticalLayout horizontalAlign="center"
paddingLeft="10" paddingRight="10"
paddingTop="10" paddingBottom="10"/>
</s:layout> <s:Label id="textSample" text="SAMPLE TEXT" color="0x000000"
fontWeight="bold" fontSize="40" filters="{[bevel]}" /> <s:HGroup width="100%" color="#323232" horizontalAlign="center">
<s:CheckBox id="blurBox" label="Blur" click="filterHandler(event)" />
<s:CheckBox id="glowBox" label="Glow" click="filterHandler(event)" />
<s:CheckBox id="shadowBox" label="Drop Shadow" click="filterHandler(event)" />
<s:CheckBox id="bevelBox" label="Bevel" selected="true" click="filterHandler(event)" />
</s:HGroup> <s:Label id="dynamicText" text="0" color="#323232" fontSize="18" filters="{[bevel]}" /> </s:Panel> </s:Application>
flex 4 Filters的更多相关文章
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十)态势标绘模块
config.xml文件的配置如下: <widget label="态势标绘" icon="assets/images/impact_area_over.png&q ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(四)地图导航控件模块
config.xml文件的配置如下: <widget left="10" top="50" config="widgets/Navigation ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(三)显示地图坐标系模块
config.xml文件的配置如下: <widget left="3" bottom="3" config="widgets/Coordinat ...
- DarkStone - 跨平台移动应用开发之 Flex 的崛起
我的好友Ds 发布一个flex的消息.我帮忙转发 DarkStone - 跨平台移动应用开发之 Flex 的崛起 (2013-08-20 22:28:32) 此文章由 周戈 (DarkSton ...
- flex+java+blazeds 多通道好文
http://www.cnblogs.com/noam/archive/2010/08/05/1793504.html blazeds, spring3整合实现RPC服务和消息服务 环境: MyEcl ...
- flex 4 transition
<s:transitions> <s:Transition fromState="default"> <s:Parallel> <mx:R ...
- Flex的基础用法【转】
//获得屏幕的分辨率 var x:Number=Capabilities.screenResolutionX; var y:Number=Capabilities.screenResolutionY; ...
- Flex中如何通过horizontalTickAligned和verticalTickAligned样式指定线图LineChart横竖方向轴心标记的例子
原文http://blog.minidx.com/2008/12/03/1669.html 接下来的例子演示了Flex中如何通过horizontalTickAligned和verticalTickAl ...
- Flex里的特效
Flex中提供了丰富的效果组件.因为效果是一种依据时间渐变的过程,因此全部效果都具有duration属性,用来设置播放时间(以毫秒为单位).也能够通过设置repeatCount属性和repeatD ...
随机推荐
- 面向对象版js分页
基于前一个js分页,我将代码改成一个面向对象版的js分页,代码如下 http://peng666.github.io/blogs/pageobj <!DOCTYPE html> <h ...
- git的初步了解
其实git我也不熟,请两天假回来宿友告诉我,我们有一份高大尚的作业.我问她们才知道原来是让我们以博客的形式写两份作业交上去.git还是我在网上查找到的,才对它有一些的了解. git是一个开源分布式版本 ...
- 【HDOJ】【3506】Monkey Party
DP/四边形不等式 裸题环形石子合并…… 拆环为链即可 //HDOJ 3506 #include<cmath> #include<vector> #include<cst ...
- JSP页面批量选择&全选操作&选择回显
效果如下: js验证部分: 页面body部分: 附:控制器Controller中验证批量选择条件回显:
- ios UI实现技巧
statusBar 移动位置 NSString *key = [[NSString alloc] initWithData:[NSData dataWithBytes:(unsigned ] enco ...
- nodeJs 初探 ~
今天晚上,开始时间了一下nodejs,跟着 Node入门 一步步的往下走.对node开发也有了初步的了解. 期间没有碰到什么问题,只有在最后的时候,碰到了几个问题.在这里记录一下: 1 . cross ...
- 说说Thread.Sleep(0)的那些奇怪的事
写在前面 最近在弄一个传输组件,用到很多多线程的知识,其中有个问题,困扰我很久,不知道是什么原因,脑子一热,在传输过程中,添加了一句代码Thread.Sleep(0).那个问题竟然解决了,耗费我一上午 ...
- WSDL
WSDL 彻底理解webservice SOAP WSDL WSDL 详解 http://www.cnblogs.com/hujian/p/3494064.html http://www.cnblog ...
- doctype声明、浏览器的标准、怪异等模式
doctype 标准(严格)模式(Standards Mode).怪异(混杂)模式(Quirks Mode),如何触发,区分他们有何意义? 触发标准模式 1.加DOCTYPE声明,比如:<!DO ...
- Sqli-labs less 41
Less-41 此处与less-39是一致的,区别在于41错误不回显.所以我们称之为盲注. Payload: http://192.168.11.189/sqli-labs/Less-41/index ...