用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: 正在从服务器检索数据...
正在从服务器检索数据...
fl.motion 

FunctionEase  - AS3 Flash

fl.motion
public class FunctionEase
继承FunctionEase Inheritance Object
实现 ITween

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

通过 FunctionEase 类,可以用自定义插值函数代替其他插值(如 SimpleEase 和 CustomEase)用于 fl.motion 框架。 fl.motion 框架在 fl.motion.easing 包中包含几个缓动函数。

查看示例

相关 API 元素



公共属性
 属性由以下参数定义
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  easingFunction : Function = null
对带有 (t, b, c, d) 签名的函数的引用,类似 fl.motion.easing 类中的方法。
FunctionEase
  functionName : String
缓动函数的完全限定名称,如 fl.motion.easing.Bounce.easeOut()。
FunctionEase
  parameters : Array = null
要作为附加参数传递给缓动函数的值的数组(可选)。
FunctionEase
  target : String
要作为目标的动画属性的名称。
FunctionEase
公共方法
 方法由以下参数定义
  
FunctionEase(xml:XML = null)
FunctionEase 实例的构造函数。
FunctionEase
  
getValue(time:Number, begin:Number, change:Number, duration:Number):Number
使用指定的缓动函数计算动画数值属性的插补值。
FunctionEase
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
属性详细信息

easingFunction

属性
public var easingFunction:Function = null

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

对带有 (t, b, c, d) 签名的函数(如 fl.motion.easing 类中的方法)的引用。

相关 API 元素

functionName

属性 
functionName:String

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

缓动函数的完全限定名称,如 fl.motion.easing.Bounce.easeOut()。该函数必须是某个类的一个方法(Bounce、Cubic、Elastic、另一个类)。如果 Flash Player 无法找到该类,将引发异常。



实现
    public function get functionName():String
    public function set functionName(value:String):void

相关 API 元素

parameters

属性 
public var parameters:Array = null

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

要作为附加参数传递给缓动函数的值的数组(可选)。

target

属性 
target:String

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

要作为目标的动画属性的名称。



实现
    public function get target():String
    public function set target(value:String):void

相关 API 元素

构造函数详细信息

FunctionEase

()构造函数
public function FunctionEase(xml:XML = null)

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

FunctionEase 实例的构造函数。

参数
xml:XML (default = null) — 一个可选 E4X XML 实例。

相关 API 元素

方法详细信息

getValue

()方法
public function getValue(time:Number, begin:Number, change:Number, duration:Number):Number

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

使用指定的缓动函数计算动画数值属性的插补值。 如果 parameters 数组已经事先设置,则在除了 time、begin、change 和 duration 值以外,上述值也将传递给缓动函数。

参数

time:Number — 时间值,必须介于 0duration 之间(包括二者)。您可以选择任何单位(例如,帧、秒、毫秒),但您的选择必须与 duration 的单位匹配。
 
begin:Number — 当时间为 0 时,补间开始的动画属性值。
 
change:Number — 补间过程中,动画属性值的变化。 该值可以为正,也可以为负。 例如,如果对象从 90 度旋转到 60 度,则 change 为 -30。
 
duration:Number — 补间的时间长度。 必须大于零。 您可以选择任何单位(例如,帧、秒、毫秒),但您的选择必须与 time 的单位匹配。

返回
Number — 指定时间的插补值。
FunctionEaseExample.as

此示例使用 fl.motion.easing 包的 Back 效果作为自定义函数缓动:
import fl.motion.Animator;
//// These two lines must be added to use <FunctionEase>
import fl.motion.easing.*; // import the easing classes
fl.motion.easing.Back; // add a reference to every easing class you want to use
////
var mc2_xml:XML = <Motion duration="30" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
    <source>
        <Source frameRate="30" x="85.05" y="90.05" scaleX="0.999" scaleY="0.999" rotation="0" elementType="movie clip" instanceName="mc2" symbolName="BoxSymbol" linkageID="Box" class="Box">
            <dimensions>
                <geom:Rectangle left="-39" top="-52" width="77" height="97"/>
            </dimensions>
            <transformationPoint>
                <geom:Point x="0.5019480519480519" y="0.5010309278350515"/>
            </transformationPoint>
        </Source>
    </source>

    <Keyframe index="0">
        <tweens>
            <FunctionEase functionName="fl.motion.easing.Back.easeInOut"/>
        </tweens>
    </Keyframe>

    <Keyframe index="29" x="330" y="0"/>
</Motion>;

var mc2_animator:Animator = new Animator(mc2_xml, mc2);
mc2_animator.play();




[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。