包 | spark.effects |
类 | public class AnimateColor |
继承 | AnimateColor ![]() ![]() ![]() ![]() |
语言版本: | ActionScript 3.0 |
产品版本: | Flex 4 |
运行时版本: | Flash Player 10, AIR 1.5 |

The <s:AnimateColor>
tag
inherits all of the tag attributes of its superclass,
and adds the following tag attributes:
<s:AnimateColor Properties id="ID" colorFrom="no default" colorPropertyName="color" colorTo="no default" />
默认 MXML 属性motionPaths
相关 API 元素
公共属性
属性 | 由以下参数定义 | ||
---|---|---|---|
![]() | className : String [只读]
效果类的名称,如“Fade”。 | Effect | |
colorFrom : uint = 0xFFFFFFFF
起始颜色值。 | AnimateColor | ||
colorPropertyName : String = "color"
此动画所影响的目标对象上的 color 属性的名称。 | AnimateColor | ||
colorTo : uint = 0xFFFFFFFF
结束颜色值。 | AnimateColor | ||
![]() | constructor : Object
对类对象或给定对象实例的构造函数的引用。 | Object | |
![]() | customFilter : mx.effects:EffectTargetFilter
指定一个 EffectTargetFilter 类型的自定义滤镜对象,效果将使用此对象来确定播放效果的目标。 | Effect | |
![]() | disableLayout : Boolean
如果为 true,则效果通过将容器的 autoLayout 属性设置为 false 对其目标的父容器禁用布局,并同时对目标对象禁用任何布局约束。 | Animate | |
![]() | duration : Number
效果的持续时间(以毫秒为单位)。 | Effect | |
![]() | easer : IEaser
此效果的缓动行为。 | Animate | |
![]() | effectTargetHost : mx.effects:IEffectTargetHost
一个属性,您可以通过设置此属性访问数据效果基于列表的目标控件。 | Effect | |
![]() | filter : String
指定用于过滤效果目标的算法。 | Effect | |
![]() | hideFocusRing : Boolean
确定在开始播放效果时,效果是否应隐藏对焦环。 | Effect | |
![]() | instanceClass : Class
一个 Class 类型的对象,用于指定此效果类的效果实例类。 | Effect | |
![]() | interpolator : IInterpolator
此效果计算属性的起始值和结束值之间的值所用的插补器。 | Animate | |
![]() | isPlaying : Boolean [只读]
一个只读标志,如果当前正在播放效果的任一实例,则为 true;否则,则为 false。 | Effect | |
![]() | motionPaths : Vector.<MotionPath>
MotionPath 对象的 Vector,其中的每个对象都带有正在设置动画的属性的名称以及该属性在动画过程中所采用的值。 | Animate | |
![]() | perElementOffset : Number
在效果的第一个目标之后,其他效果目标的附加延迟(以毫秒为单位)。 | Effect | |
![]() | playheadTime : Number
效果的当前时间位置。 | Effect | |
![]() | relevantProperties : Array
一个属性名称 Array,执行过滤时将使用这些名称。 | Effect | |
![]() | relevantStyles : Array
一个样式名称 Array,执行过滤时将使用这些名称。 | Effect | |
![]() | repeatBehavior : String
一种重复效果的行为,这意味着 repeatCount 等于 0 或大于 1 的效果。 | Animate | |
![]() | repeatCount : int = 1
效果的重复次数。 | Effect | |
![]() | repeatDelay : int = 0
重复播放效果前需要等待的时间(以毫秒为单位)。 | Effect | |
![]() | startDelay : int = 0
开始播放效果前需要等待的时间(以毫秒为单位)。 | Effect | |
![]() | target : Object
要应用此效果的对象。 | Effect | |
![]() | targets : Array
一个对象 Array,这些对象都是效果的目标。 | Effect | |
![]() | triggerEvent : Event
如果触发了某个效果,则此项目是由 EffectManager 传递给此 Effect 的 Event 对象;如果 EffectManager 当前没有播放此效果,则为 null。 | Effect |
受保护的属性
公共方法
方法 | 由以下参数定义 | ||
---|---|---|---|
AnimateColor(target:Object = null)
构造函数。 | AnimateColor | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。 | EventDispatcher | |
![]() |
捕获效果目标上相关属性的当前值,并将这些值另存为结束值。 | Effect | |
![]() |
捕获另一组目标相关属性的当前值。在运行数据更改效果时,Flex 将使用此函数。
| Effect | |
![]() |
捕获效果目标上相关属性的当前值。 | Effect | |
![]() |
创建一个效果实例并对其进行初始化。 | Effect | |
![]() |
获取一个目标对象 Array,并对每个目标调用 createInstance() 方法。 | Effect | |
![]() |
删除实例中的事件侦听器,然后从实例列表中删除该实例。 | Effect | |
![]() |
将事件调度到事件流中。 | EventDispatcher | |
![]() |
中断当前正在播放的效果,立即跳转到该效果的末尾。 | Effect | |
![]() |
返回一个字符串 Array,其中每个 String 都是被此效果更改的属性的名称。 | Effect | |
![]() |
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。 | EventDispatcher | |
![]() |
表示对象是否已经定义了指定的属性。 | Object | |
![]() |
表示 Object 类的实例是否在指定为参数的对象的原型链中。 | Object | |
![]() |
暂停效果,直到调用 resume() 方法。 | Effect | |
![]() |
开始播放效果。 | Effect | |
![]() |
表示指定的属性是否存在、是否可枚举。 | Object | |
![]() |
从 EventDispatcher 对象中删除侦听器。 | EventDispatcher | |
![]() |
在效果由 pause() 方法暂停后继续播放效果。 | Effect | |
![]() |
逆序播放效果;如果当前正在播放效果,则从该效果的当前位置开始逆序播放。 | Effect | |
![]() |
设置循环操作动态属性的可用性。 | Object | |
![]() |
停止播放效果,使效果目标保持当前状态。 | Effect | |
![]() |
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。 | Object | |
![]() |
返回指定对象的字符串表示形式。 | Object | |
![]() |
返回指定对象的原始值。 | Object | |
![]() |
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。 | EventDispatcher |
受保护的方法
属性详细信息
colorFrom | 属性 |
public var colorFrom:uint = 0xFFFFFFFF
语言版本: | ActionScript 3.0 |
产品版本: | Flex 4 |
运行时版本: | Flash Player 10, AIR 1.5 |
起始颜色值。
默认值为 0xFFFFFF。
colorPropertyName | 属性 |
public var colorPropertyName:String = "color"
语言版本: | ActionScript 3.0 |
产品版本: | Flex 4 |
运行时版本: | Flash Player 10, AIR 1.5 |
此动画所影响的目标对象上的 color 属性的名称。color 属性是采用 32 位颜色值的属性。
默认值为 "color"。
colorTo | 属性 |
public var colorTo:uint = 0xFFFFFFFF
语言版本: | ActionScript 3.0 |
产品版本: | Flex 4 |
运行时版本: | Flash Player 10, AIR 1.5 |
结束颜色值。
默认值为 0xFFFFFF。
构造函数详细信息
AnimateColor | () | 构造函数 |
示例 如何使用本示例
AnimateColorEffectExample.mxml
<?xml version="1.0"?> <!-- Simple example to demonstrate the s:AnimateColor class. --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"> <fx:Declarations> <s:AnimateColor id="colorEffect" targets="{[examplePanel, targetLabel, detailText]}" colorFrom="0x0000FF" colorTo="0xFF0000" repeatCount="2" repeatBehavior="reverse" effectStart="playButton.enabled=false" effectEnd="playButton.enabled=true;"/> <s:AnimateColor id="colorEffectBackground" colorPropertyName="borderColor" target="{examplePanel}" colorFrom="0xBBBBBB" colorTo="0xFF4444" repeatCount="2" repeatBehavior="reverse" effectStart="playButton.enabled=false" effectEnd="playButton.enabled=true;"/> </fx:Declarations> <s:Panel id="examplePanel" title="AnimateColor Effect Example" width="75%" height="75%"> <s:HGroup top="5"> <!-- Our target to affect--> <s:VGroup id="targetBox" width="50%" horizontalAlign="center"> <s:Label id="targetLabel" text="Nokia 9930" fontSize="14"/> <s:BitmapImage id="targetImg" source="@Embed(source='assets/Nokia_6630.png')"/> </s:VGroup> <s:VGroup id="detailsBox" width="50%" left="0"> <s:Label id="detailText" width="99%" color="blue" text="The:AnimateColor effect changes the color of a target using the following parameters: colorFrom, colorTo. Click 'Animate Color' to watch the effect."/> </s:VGroup> </s:HGroup> <s:Rect left="0" right="0" bottom="0" height="30"> <s:fill> <s:LinearGradient rotation="90"> <s:GradientEntry color="0xE2E2E2" /> <s:GradientEntry color="0xD9D9D9" /> </s:LinearGradient> </s:fill> </s:Rect> <s:Button id="playButton" left="5" bottom="5" label="Animate Color" click="colorEffect.play();colorEffectBackground.play();"/> </s:Panel> </s:Application>
Tue Jun 12 2018, 11:04 AM Z