1////////////////////////////////////////////////////////////////////////////////
2//
3//  ADOBE SYSTEMS INCORPORATED
4//  Copyright 2008 Adobe Systems Incorporated
5//  All Rights Reserved.
6//
7//  NOTICE: Adobe permits you to use, modify, and distribute this file
8//  in accordance with the terms of the license agreement accompanying it.
9//
10////////////////////////////////////////////////////////////////////////////////
11package spark.effects
12{
13
14import spark.effects.easing.IEaser;
15import spark.effects.supportClasses.AnimateFilterInstance;
16
17import mx.core.mx_internal;
18import mx.effects.Effect;
19import mx.effects.IEffectInstance;
20import mx.events.EffectEvent;
21import mx.filters.IBitmapFilter;
22import mx.styles.IStyleClient;
23
24use namespace mx_internal;
25
26/**
27 *  The AnimateFilter effect applies an mx.filters.IBitmapFilter instance to the target
28 *  and allows you to animate properties of the filter between values.
29 *  Unlike effects that animate properties of the target,
30 *  the AnimateFilter effect animates properties of the filter applied to the target.
31 *
32 *  <p>The filters that you can use with this effect are defined in the spark.filters. package.
33 *  Common filters include the DropShadowFilter, GlowFilter, BlurFilter, and ShaderFilter.</p>
34 *
35 *  <p>To define the properties of the filter to animate, pass an Array of SimpleMotionPath objects
36 *  to the to the <code>motionPath</code> property of the AnimateFilter effect.
37 *  Each SimpleMotionPath object defines a property on the filer,
38 *  the starting value of the property, and the ending value of the property.</p>
39 *
40 *  @mxml
41 *
42 *  <p>The <code>&lt;s:AnimateFilter&gt;</code> tag
43 *  inherits all of the tag attributes of its superclass,
44 *  and adds the following tag attributes:</p>
45 *
46 *  <pre>
47 *  &lt;s:AnimateFilter
48 *    <b>Properties</b>
49 *    id="ID"
50 *    bitmapFilter="no default"
51 *  /&gt;
52 *  </pre>
53 *
54 *  @see spark.effects.supportClasses.AnimateFilterInstance
55 *
56 *  @includeExample examples/AnimateFilterEffectExample.mxml
57 *
58 *  @langversion 3.0
59 *  @playerversion Flash 10
60 *  @playerversion AIR 1.5
61 *  @productversion Flex 4
62 */
63public class AnimateFilter extends Animate
64{
65    include "../core/Version.as";
66
67    //--------------------------------------------------------------------------
68    //
69    //  Constructor
70    //
71    //--------------------------------------------------------------------------
72
73    /**
74     *  Constructor.
75     *
76     *  @param target The Object to animate with this effect.
77     *
78     *  @param filter The filter to apply to the target.
79     *  The filters that you can use with this effect are
80     *  defined in the spark.filters. package.
81     *
82     *  @langversion 3.0
83     *  @playerversion Flash 10
84     *  @playerversion AIR 1.5
85     *  @productversion Flex 4
86     */
87    public function AnimateFilter(target:Object = null, filter:IBitmapFilter = null)
88    {
89        super(target);
90        instanceClass = AnimateFilterInstance;
91        this.bitmapFilter = filter;
92    }
93
94    //--------------------------------------------------------------------------
95    //
96    //  Properties
97    //
98    //--------------------------------------------------------------------------
99
100    //----------------------------------
101    //  bitmapFilter
102    //----------------------------------
103
104    /**
105     *  IBitmapFilter instance to apply and animate.
106     *
107     *  <p>The filters that you can use with this effect are defined in the spark.filters. package.
108     *  Common filters include the DropShadowFilter, GlowFilter, BlurFilter, and ShaderFilter.</p>
109     *
110     *  @langversion 3.0
111     *  @playerversion Flash 10
112     *  @playerversion AIR 1.5
113     *  @productversion Flex 4
114     */
115    public var bitmapFilter:IBitmapFilter;
116
117    //--------------------------------------------------------------------------
118    //
119    // Methods
120    //
121    //--------------------------------------------------------------------------
122
123    /**
124     * @private
125     */
126    override public function getAffectedProperties():Array /* of String */
127    {
128        return [];
129    }
130
131
132    /**
133     *  @private
134     */
135    override protected function initInstance(instance:IEffectInstance):void
136    {
137        super.initInstance(instance);
138        var animateInstance:AnimateFilterInstance = instance as AnimateFilterInstance;
139        animateInstance.bitmapFilter = bitmapFilter;
140    }
141}
142}