加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex特效小结

发布时间:2020-12-15 04:13:39 所属栏目:百科 来源:网络整理
导读:组件翻转切换------------------------------ ?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" minWidt

组件翻转切换------------------------------
<?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",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>


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. 中可用。这些滤镜(颜色矩阵滤镜、卷积滤镜和置换图滤镜)所创建的效果具有极其灵活的形式;它们不仅仅可以进行优化以生成单一的效果,而且还具有强大的功能和灵活性。例如,如果为卷积滤镜的矩阵选择不同的值,则它可用于创建模糊、浮雕、锐化、查找颜色边缘、变形等效果。

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读