Paket | spark.effects.easing |
Klass | public class Bounce |
Arv | Bounce Object |
Implementerar | IEaser |
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 4 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Publika egenskaper
Publika metoder
Metod | Definieras med | ||
---|---|---|---|
Bounce()
Constructor. | Bounce | ||
Takes the fraction representing the elapsed duration of an animation
(a value between 0.0 to 1.0) and returns a new elapsed value. | Bounce | ||
Anger om det finns en egenskap angiven för ett objekt. | Object | ||
Anger om en instans av klassen Object finns i prototypkedjan för objektet som anges som parameter. | Object | ||
Anger om den angivna egenskapen finns och är uppräkningsbar. | Object | ||
Anger tillgänglighet för en dynamisk egenskap för slingåtgärder. | Object | ||
Returnerar det här objektets strängrepresentation, formaterad i enlighet med språkspecifika konventioner. | Object | ||
Returnerar det angivna objektets strängbeteckning. | Object | ||
Returnerar det angivna objektets primitiva värde. | Object |
Konstruktordetaljer
Bounce | () | Konstruktor |
public function Bounce()
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 4 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Constructor.
Metoddetaljer
ease | () | metod |
public function ease(fraction:Number):Number
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 4 |
Körningsmiljöversioner: | Flash Player 10, AIR 1.5 |
Takes the fraction representing the elapsed duration of an animation (a value between 0.0 to 1.0) and returns a new elapsed value. This value is used to calculate animated property values. By changing the value of the elapsed fraction, you effectively change the animation of the property.
Parametrar
fraction:Number — The elapsed fraction of an animation, from 0.0 to 1.0.
|
Number — The eased value for the elapsed time. Typically, this value
should be constrained to lie between 0.0 and 1.0, although it is possible
to return values outside of this range. Note that the results of
returning such values are undefined, and depend on what kind of
effects are using this eased value. For example, an object moving
in a linear fashion can have positions calculated outside of its start
and end point without a problem, but other value types (such as color)
may not result in desired effects if they use time values that cause
them to surpass their endpoint values.
|
Exempel Så här använder du exemplet
BounceElasticEffectExample.mxml
<?xml version="1.0"?> <!-- Simple example to demonstrate the s:Bounce and s:Elastic classes. --> <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:Bounce id="bounceEasing"/> <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="{bounceEasing}"/> </fx:Declarations> <s:Panel id="examplePanel" title="Bounce and Elastic 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, 01:40 PM Z