Flex特效小结

 

组件翻转切换------------------------------

<span style="background-color:#ffffff"><?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" 
			   width="300"
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
	<s:states> 
		<s:State name="show"/>
		<s:State name="create"/>
	</s:states> 
	<fx:Declarations> 
		<s:Power id="powerEasing" exponent="6"/> 
	</fx:Declarations> 
	<s:transitions> 
		<s:Transition toState="create" fromState="show"> 
			<s:Sequence> 
				<s:Rotate3D target="{showGroup}" autoCenterTransform="true" repeatCount="1" duration="500" angleYTo="90" angleYFrom="0"/> 
				<s:SetAction target="{showGroup}" value="false" property="includeInLayout"/> 
				<s:SetAction target="{showGroup}" value="false" property="visible"/> 
				<s:SetAction target="{createGroup}" value="true" property="includeInLayout"/> 
				<s:SetAction target="{createGroup}" value="true" property="visible"/> 
				<s:Rotate3D target="{createGroup}" autoCenterTransform="true" repeatCount="1" duration="500" angleYTo="0" angleYFrom="-90"/>
			</s:Sequence>
		</s:Transition> 
		<s:Transition toState="show" fromState="create"> 
			<s:Sequence> <s:Rotate3D target="{createGroup}" autoCenterTransform="true" repeatCount="1" duration="600" angleYTo="90" angleYFrom="0"/>
				<s:SetAction target="{createGroup}" value="false" property="includeInLayout"/>
				<s:SetAction target="{createGroup}" value="false" property="visible"/> 
				<s:SetAction target="{showGroup}" value="true" property="includeInLayout"/>
				<s:SetAction target="{showGroup}" value="true" property="visible"/> 
				<s:Rotate3D target="{showGroup}" autoCenterTransform="true" repeatCount="1" duration="600" angleYTo="0" angleYFrom="-90"/>
			</s:Sequence> </s:Transition> 
	</s:transitions> 
	<fx:Script> 
		<![CDATA[ 
			import mx.collections.ArrayCollection;
			private var array:Array = [ 
				{username:"zss", role:"admin", createtime:"2012-0606 13:44:45" },
				{username:"zss", role:"admin", createtime:"2012-0606 13:44:45" },
				{username:"zss", role:"admin", createtime:"2012-0606 13:44:45" },
				{username:"zss", role:"admin", createtime:"2012-0606 13:44:45" },
				{username:"zss", role:"admin", createtime:"2012-0606 13:44:45" }, 
				{username:"zss", role:"admin", createtime:"2012-0606 13:44:45" },
				{username:"zss", role:"admin", createtime:"2012-0606 13:44:45" }
			];
			[Bindable]
			private var usersData:ArrayCollection = new ArrayCollection(array);
		]]>
	</fx:Script> 
	<s:layout>
		<s:VerticalLayout paddingTop="20" paddingRight="20" paddingLeft="20" paddingBottom="20" gap="0"/>
	</s:layout> 
	<s:VGroup width="100%" id="showGroup" includeInLayout.create="false" visible.create="false">
		<s:Label height="25" width="100%" paddingLeft="10" styleName="label1" text="Summary of Users"/> 
		<s:DataGrid height="100%" width="100%" dataProvider="{usersData}"> 
			<s:columns>
				<s:ArrayList> 
					<s:GridColumn headerText="User" dataField="username"/> 
					<s:GridColumn headerText="Role" dataField="role"/> 
					<s:GridColumn headerText="Create Time" dataField="createtime"/> 
				</s:ArrayList>
			</s:columns> 
		</s:DataGrid> 
		<s:Button width="120" click="this.currentState='create';" label="Create New User"/> 
	</s:VGroup> 
	<s:VGroup width="100%" id="createGroup" horizontalAlign="left" includeInLayout.show="false" visible.show="false"> 
		<s:Label height="25" width="100%" paddingLeft="10" styleName="label1" text="Create User"/> 
		<s:Form width="100%"> 
			<s:layout>
				<s:VerticalLayout paddingTop="2" paddingBottom="2" gap="2"/>
			</s:layout> 
			<s:FormItem label="User Name:"> 
				<s:TextInput/> 
			</s:FormItem> 
			<s:FormItem label="Role:"> 
				<s:DropDownList> 
					<s:ArrayList> ["viewer","admin"] </s:ArrayList>
				</s:DropDownList> 
			</s:FormItem> 
			<s:FormItem label="Password:"> 
				<s:TextInput displayAsPassword="true"/> 
			</s:FormItem> 
			<s:FormItem label="Retype Password:"> 
				<s:TextInput displayAsPassword="true"/> 
			</s:FormItem> 
		</s:Form> 
		<s:HGroup width="100%"> 
			<s:Button click="this.currentState='show';" label="Create"/> 
			<s:Button click="this.currentState='show';" label="Cancel"/> 
		</s:HGroup> 
	</s:VGroup> 
</s:Application></span>

 

ActionScript. 3.0 包括 9 个可用于显示对象和 BitmapData 对象的滤镜类----------------------

1、斜角滤镜(BevelFilter 类)
2、模糊滤镜(BlurFilter 类)
3、投影滤镜(DropShadowFilter 类)
4、发光滤镜(GlowFilter 类)
5、渐变斜角滤镜(GradientBevelFilter 类)
6、渐变发光滤镜(GradientGlowFilter 类)
7、颜色矩阵滤镜(ColorMatrixFilter 类)
8、卷积滤镜(ConvolutionFilter 类)
9、置换图滤镜(DisplacementMapFilter 类)

前六个滤镜是简单滤镜,可用于创建一种特定效果,并可以对效果进行某种程度的自定义。可以使用 ActionScript. 应用这六个滤镜,也可以在 Adobe Flash CS3 Professional 中使用"滤镜"面板将其应用于对象。因此,即使您要使用 ActionScript. 应用滤镜,如果有 Flash 创作工具,也可以使用可视界面快速尝试不同的滤镜和设置,弄清楚如何创建需要的效果。
最后三个滤镜仅在 ActionScript. 中可用。这些滤镜(颜色矩阵滤镜、卷积滤镜和置换图滤镜)所创建的效果具有极其灵活的形式;它们不仅仅可以进行优化以生成单一的效果,而且还具有强大的功能和灵活性。例如,如果为卷积滤镜的矩阵选择不同的值,则它可用于创建模糊、浮雕、锐化、查找颜色边缘、变形等效果。

-------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值