| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- saved from url=(0014)about:internet --><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="../../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../../override.css" type="text/css"><meta name="keywords" content="Elastic,spark.effects.easing.Elastic,ease,ease,ease,ease,ease,easeIn,easeOut"><title>spark.effects.easing.Elastic</title><script src="../../../AC_OETags.js" type="text/javascript"></script></head><body><script language="javascript" type="text/javascript" src="../../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../../help.js"></script><script language="javascript" type="text/javascript" src="../../../cookies.js"></script><script language="javascript" type="text/javascript"><!-- |
| asdocTitle = 'Elastic - ApacheFlex API Reference'; |
| var baseRef = '../../../'; |
| window.onload = configPage; |
| --></script> |
| <script type="text/javascript"> |
| scrollToNameAnchor(); |
| </script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">Apache Flex 4.16.1 API Reference </td><td class="titleTableTopNav" align="right"><a href="../../../package-summary.html" onclick="loadClassListFrame('../../../all-classes.html')">All Packages</a> | <a href="../../../class-summary.html" onclick="loadClassListFrame('../../../all-classes.html')">All Classes</a> | <a href="../../../all-index-A.html" onclick="loadClassListFrame('../../../index-list.html')">Index</a> | <a id="framesLink1" href="../../../index.html?spark/effects/easing/Elastic.html&spark/effects/easing/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../../images/logo.jpg" class="logoImage" alt="AdobeLogo" title="AdobeLogo"></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">Elastic</td><td class="titleTableSubNav" id="subNav" align="right"><a href="#methodSummary">Methods</a> | <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3"> </td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve"> |
| <!-- |
| |
| if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Elastic"); titleBar_setSubNav(false,false,false,false,false,false,false,false,true,true,false ,false,false,false,false,false);} |
| --> |
| </script><div xmlns:fn="http://www.w3.org/2005/xpath-functions" class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">spark.effects.easing</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Elastic</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Elastic <img src="../../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> Object</td></tr><tr><td class="classHeaderTableLabel">Implements</td><td> <a href="../../../spark/effects/easing/IEaser.html">IEaser</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p></p><p></p> |
| The Elastic class implements easing functionality where the target object |
| movement is defined by an exponentially decaying sine wave. |
| The effect target decelerates toward the end value, and continues past the end value. |
| It then oscillates around the end value in smaller and smaller increments, |
| before reaching the end value. |
| <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><br/><hr></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th> </th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#Elastic()" class="signatureLink">Elastic</a>()</div><div class="summaryTableDescription"> |
| Constructor.</div></td><td class="summaryTableOwnerCol">Elastic</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#ease()" class="signatureLink">ease</a>(fraction:Number):Number</div><div class="summaryTableDescription"> |
| |
| Takes the fraction representing the elapsed duration of an animation |
| (a value between 0.0 to 1.0) and returns a new elapsed value.</div></td><td class="summaryTableOwnerCol">Elastic</td></tr></table></div><script language="javascript" type="text/javascript"><!-- |
| showHideInherited(); |
| --></script><div class="MainContent"><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="Elastic()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">Elastic</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function Elastic()</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p> |
| Constructor. |
| |
| </p></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="ease()"></a><a name="ease(Number)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">ease</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function ease(fraction:Number):Number</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p> |
| |
| 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. |
| |
| </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">fraction</span>:Number</code> — The elapsed fraction of an animation, from 0.0 to 1.0. |
| |
| </td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Number</code> — 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. |
| |
| </td></tr></table></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples</div><div class="exampleHeader">BounceElasticEffectExample.mxml</div><div class="detailBody"><div class="listing"><pre><?xml version="1.0"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <!-- 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> |
| </pre></div><script language="javascript" type="text/javascript"><!-- AC_FL_RunContent( "src", "examples/BounceElasticEffectExample", "width", "100%", |
| "height","400px", "salign", "TL", "id", "example1", "quality", "high", "bgcolor", "", "name", |
| "example1", "flashvars","", "allowScriptAccess","sameDomain", "type", |
| "application/x-shockwave-flash","pluginspage", "http://www.macromedia.com/go/getflashplayer" ); --></script></div><br/><br/><hr><br/><p></p><center class="copyright"><footer>The Apache Software Foundation</footer><br/>Wed Nov 15 2017, 09:50 AM +01:00 </center></div></body></html><!--The Apache Software Foundation<br/>Wed Nov 15 2017, 09:50 AM +01:00 --> |