套件 | spark.effects.easing |
類別 | public class Linear |
繼承 | Linear Object |
實作 | IEaser |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
easeInFraction
property, it
then uses uniform (linear) motion through the next phase, and
finally decelerates until the end during the period specified
by the easeOutFraction
property.
The easing values for the three phases are calculated such that the behavior of constant acceleration, linear motion, and constant deceleration all occur within the specified duration of the animation.
Strict linear motion can be achieved by setting
easeInFraction
and easeOutFraction
to 0.0.
Note that if acceleration or
deceleration are not 0.0, then the motion during the middle
phase is not at the same speed as that of pure
linear motion. The middle phase consists of
uniform motion, but the speed of that motion is determined by
the size of that phase relative to the overall animation.
The <s:Linear>
tag
inherits all of the tag attributes of its of its superclass,
and adds the following tag attributes:
<s:Linear id="ID" easeInFraction="0" easeOutFraction="0" />
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
easeInFraction : Number
The fraction an animation spent accelerating,
between 0.0 and 1.0. | Linear | ||
easeOutFraction : Number
The percentage an animation will spend decelerating,
between 0.0 and 1.0. | Linear |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | Linear | ||
Calculates the eased fraction value based on the
easeInFraction and easeOutFraction
properties. | Linear | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
easeInFraction | 屬性 |
easeInFraction:Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The fraction an animation spent accelerating,
between 0.0 and 1.0.
The values of the easeOutFraction
property
and easeInFraction
property must satisfy the
equation easeOutFraction + easeInFraction <= 1
where any remaining time is spent in the linear motion phase.
預設值為 0。
實作
public function get easeInFraction():Number
public function set easeInFraction(value:Number):void
easeOutFraction | 屬性 |
easeOutFraction:Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The percentage an animation will spend decelerating,
between 0.0 and 1.0.
The values of the easeOutFraction
property
and easeInFraction
property must satisfy the
equation easeOutFraction + easeInFraction <= 1
where any remaining time is spent in the linear motion phase.
預設值為 0。
實作
public function get easeOutFraction():Number
public function set easeOutFraction(value:Number):void
Linear | () | 建構函式 |
public function Linear(easeInFraction:Number = 0, easeOutFraction:Number = 0)
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
參數easeInFraction:Number (default = 0 ) — The fraction of the overall duration
in the acceleration phase, between 0.0 and 1.0.
| |
easeOutFraction:Number (default = 0 ) — The fraction of the overall duration
in the deceleration phase, between 0.0 and 1.0.
|
ease | () | 方法 |
public function ease(fraction:Number):Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Calculates the eased fraction value based on the
easeInFraction
and easeOutFraction
properties.
If fraction
is less than easeInFraction
, it calculates a value
based on accelerating up to the linear motion phase.
If fraction
is greater than easeInFraction
and less than
(1-easeOutFraction)
, it calculates a value based
on the linear motion phase between the easing in and easing out phases.
Otherwise, it calculates a value based on constant deceleration
between the linear motion phase and 0.0.
參數
fraction:Number — The elapsed fraction of the animation,
between 0.0 and 1.0..
|
Number — The eased fraction of the animation.
|
<?xml version="1.0"?> <!-- Simple example to demonstrate the s:Linear 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:Linear id="linearEasing" easeInFraction="0.3"/> <s:Elastic id="elasticEasing"/> <s:Move id="moveRight" target="{myImage}" xBy="500" duration="2000" easer="{elasticEasing}"/> <s:Move id="moveLeft" target="{myImage}" xBy="-500" duration="2000" easer="{linearEasing}"/> </fx:Declarations> <s:Panel id="examplePanel" title="Linear Effect Example" width="75%" height="75%"> <!-- Directions --> <s:VGroup id="detailsBox" width="50%" top="5" left="5"> <s:Label width="99%" color="blue" text="Click the buttons to watch the effect."/> </s:VGroup> <mx:Image id="myImage" top="20" source="@Embed(source='assets/logo.jpg')"/> <s:Button label="Move Right" bottom="10" left="5" click="moveRight.end();moveRight.play();"/> <s:Button label="Move Left" bottom="10" left="100" click="moveLeft.end();moveLeft.play();"/> </s:Panel> </s:Application>
Tue Jun 12 2018, 03:47 PM Z