blob: 143dfaacfb81799924493800eb0d78a9b15917b9 [file] [log] [blame]
<!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="Power,spark.effects.easing.Power,IN,IN_OUT,OUT,easeInFraction,easeInFraction,easeOutFraction,exponent"><title>spark.effects.easing.Power</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 = 'Power - 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>&nbsp;|&nbsp;<a href="../../../class-summary.html" onclick="loadClassListFrame('../../../all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="../../../all-index-A.html" onclick="loadClassListFrame('../../../index-list.html')">Index</a>&nbsp;|&nbsp;<a id="framesLink1" href="../../../index.html?spark/effects/easing/Power.html&amp;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">Power</td><td class="titleTableSubNav" id="subNav" align="right"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Power"); titleBar_setSubNav(false,true,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 Power</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Power <img src="../../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="../../../spark/effects/easing/EaseInOutBase.html">EaseInOutBase</a> <img src="../../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> Object</td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</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 :&nbsp;</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 :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p></p><p></p>
The Power class defines the easing functionality using a polynomial expression.
Easing consists of two phases: the acceleration, or ease in phase,
followed by the deceleration, or ease out phase.
The rate of acceleration and deceleration is based on
the <code>exponent</code> property.
The higher the value of the <code>exponent</code> property,
the greater the acceleration and deceleration.
Use the <code>easeInFraction</code> property to specify the percentage
of an animation accelerating.
<p></p><a name="mxmlSyntaxSummary"></a><span class="classHeaderTableLabel">MXML Syntax</span><span id="showMxmlLink" style="display:none"><a href="#mxmlSyntaxSummary" onclick="toggleMXMLOnly();"><img src="../../../images/collapsed.gif" title="collapsed" alt="collapsed" class="collapsedImage">Show MXML Syntax</a><br/></span><span id="hideMxmlLink"><a href="#mxmlSyntaxSummary" onclick="toggleMXMLOnly();"><img src="../../../images/expanded.gif" title="expanded" alt="expanded" class="expandedImage">Hide MXML Syntax</a></span><div id="mxmlSyntax" class="mxmlSyntax"> <p>The <code>&lt;s:Power&gt;</code> tag
inherits all of the tag attributes of its of its superclass,
and adds the following tag attributes:</p>
<pre>
&lt;s:Power
id="ID"
exponent="2"
/&gt;
</pre>
</div><script language="javascript" type="text/javascript"><!--
setMXMLOnly();
--></script><p><a href="#includeExamplesSummary">View the examples</a></p><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><div class="showHideLinks"><div id="hideInheritedProperty" class="hideInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(false,'Property');"><img class="showHideLinkImage" src="../../../images/expanded.gif"> Hide Inherited Public Properties</a></div><div id="showInheritedProperty" class="showInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(true,'Property');"><img class="showHideLinkImage" src="../../../images/collapsed.gif"> Show Inherited Public Properties</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../../spark/effects/easing/EaseInOutBase.html#easeInFraction" class="signatureLink">easeInFraction</a> : Number<div class="summaryTableDescription">
The percentage of an animation that should be spent accelerating.</div></td><td class="summaryTableOwnerCol"><a href="../../../spark/effects/easing/EaseInOutBase.html">EaseInOutBase</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#exponent" class="signatureLink">exponent</a> : Number<div class="summaryTableDescription">
The exponent used in the easing calculation.</div></td><td class="summaryTableOwnerCol">Power</td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><div class="showHideLinks"><div id="hideInheritedMethod" class="hideInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(false,'Method');"><img class="showHideLinkImage" src="../../../images/expanded.gif"> Hide Inherited Public Methods</a></div><div id="showInheritedMethod" class="showInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(true,'Method');"><img class="showHideLinkImage" src="../../../images/collapsed.gif"> Show Inherited Public Methods</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#Power()" class="signatureLink">Power</a>(easeInFraction:Number = 0.5, exponent:Number = 2)</div><div class="summaryTableDescription">
Constructor.</div></td><td class="summaryTableOwnerCol">Power</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../../spark/effects/easing/EaseInOutBase.html#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"><a href="../../../spark/effects/easing/EaseInOutBase.html">EaseInOutBase</a></td></tr></table></div><a name="methodSummary"></a><a name="protectedMethodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Protected Methods </div><div class="showHideLinks"><div id="hideInheritedProtectedMethod" class="hideInheritedProtectedMethod"><a class="showHideLink" href="#protectedMethodSummary" onclick="javascript:setInheritedVisible(false,'ProtectedMethod');"><img class="showHideLinkImage" src="../../../images/expanded.gif"> Show Inherited Protected Methods</a></div><div id="showInheritedProtectedMethod" class="showInheritedProtectedMethod"><a class="showHideLink" href="#protectedMethodSummary" onclick="javascript:setInheritedVisible(true,'ProtectedMethod');"><img class="showHideLinkImage" src="../../../images/collapsed.gif"> Show Inherited Protected Methods</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable hideInheritedProtectedMethod" id="summaryTableProtectedMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class="hideInheritedProtectedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../../spark/effects/easing/EaseInOutBase.html#easeIn()" class="signatureLink">easeIn</a>(fraction:Number):Number</div><div class="summaryTableDescription">
Returns a value that represents the eased fraction during the
ease in phase of the animation.</div></td><td class="summaryTableOwnerCol"><a href="../../../spark/effects/easing/EaseInOutBase.html">EaseInOutBase</a></td></tr><tr class="hideInheritedProtectedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../../spark/effects/easing/EaseInOutBase.html#easeOut()" class="signatureLink">easeOut</a>(fraction:Number):Number</div><div class="summaryTableDescription">
Returns a value that represents the eased fraction during the
ease out phase of the animation.</div></td><td class="summaryTableOwnerCol"><a href="../../../spark/effects/easing/EaseInOutBase.html">EaseInOutBase</a></td></tr></table></div><script language="javascript" type="text/javascript"><!--
showHideInherited();
--></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="exponent"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">exponent</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>exponent:Number</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</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 :&nbsp;</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 :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p></p><p>
The exponent used in the easing calculation.
The higher the value of the <code>exponent</code> property,
the greater the acceleration and deceleration.
For example, to get quadratic behavior, set <code>exponent</code> to 2.
To get cubic behavior, set <code>exponent</code> to 3.
</p><p> The default value is <code>2</code>.</p><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get exponent():Number</code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set exponent(value:Number):void</code><br/></div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="Power()"></a><a name="Power(Number,Number)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">Power</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function Power(easeInFraction:Number = 0.5, exponent:Number = 2)</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version :&nbsp;</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 :&nbsp;</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 :&nbsp;</b></td><td>Flash Player 10, AIR 1.5</td></tr></table><p></p><p>
Constructor.
</p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">easeInFraction</span>:Number</code> (default = <code>0.5</code>)<code></code> &mdash; The fraction of the overall duration
in the acceleration phase, between 0.0 and 1.0.
</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">exponent</span>:Number</code> (default = <code>2</code>)<code></code> &mdash; The exponent used in the easing calculation.
</td></tr></table></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples</div><div class="exampleHeader">SinePowerEffectExample.mxml</div><div class="detailBody"><div class="listing"><pre>&lt;?xml version="1.0"?&gt;
&lt;!--
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.
--&gt;
&lt;!-- Simple example to demonstrate the s:Sine and s:Power classes. --&gt;
&lt;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"&gt;
&lt;fx:Declarations&gt;
&lt;s:Sine id="sineEasing"
easeInFraction="0.3"/&gt;
&lt;s:Power id="powerEasing"
exponent="4"/&gt;
&lt;s:Move id="moveRight"
target="{myImage}"
xBy="500"
duration="2000"
easer="{powerEasing}"/&gt;
&lt;s:Move id="moveLeft"
target="{myImage}"
xBy="-500"
duration="2000"
easer="{sineEasing}"/&gt;
&lt;/fx:Declarations&gt;
&lt;s:Panel id="examplePanel"
title="Sine and Power Effect Example"
width="75%" height="75%"&gt;
&lt;!-- Directions --&gt;
&lt;s:VGroup id="detailsBox" width="50%" top="5" left="5"&gt;
&lt;s:Label width="99%" color="blue"
text="Click the buttons to watch the effect."/&gt;
&lt;/s:VGroup&gt;
&lt;mx:Image id="myImage" top="20"
source="@Embed(source='assets/logo.jpg')"/&gt;
&lt;s:Button label="Move Right"
bottom="10" left="5"
click="moveRight.end();moveRight.play();"/&gt;
&lt;s:Button label="Move Left"
bottom="10" left="100"
click="moveLeft.end();moveLeft.play();"/&gt;
&lt;/s:Panel&gt;
&lt;/s:Application&gt;
</pre></div><script language="javascript" type="text/javascript"><!-- AC_FL_RunContent( "src", "examples/SinePowerEffectExample", "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 -->