<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; AnimateProperties</title>
	<atom:link href="http://blog.flexexamples.com/category/animateproperties/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Auto scrolling the contents of a VGroup container in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 23:50:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[AnimateProperties]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[Scroller (Spark)]]></category>
		<category><![CDATA[VerticalLayout (Spark)]]></category>
		<category><![CDATA[VGroup (Spark)]]></category>
		<category><![CDATA[fractionOfElementInView()]]></category>
		<category><![CDATA[getElementIndex()]]></category>
		<category><![CDATA[getScrollPositionDeltaToElement()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2136</guid>
		<description><![CDATA[<p>The following example shows how you can tab through a series of Spark TextInput controls in Flex 4 and auto-scroll the VGroup container so that the currently focused text field has focus by using the fractionOfElementInView() method, getScrollPositionDeltaToElement() method, and verticalScrollPosition property.</p> <p>Full code after the jump.</p> <p></p> <p class="note">And a big thanks to <a [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can tab through a series of Spark TextInput controls in Flex 4 and auto-scroll the VGroup container so that the currently focused text field has focus by using the <code>fractionOfElementInView()</code> method, <code>getScrollPositionDeltaToElement()</code> method, and <code>verticalScrollPosition</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-2136"></span></p>
<p class="note">And a big thanks to <a href="http://hansmuller-flex.blogspot.com/">Hans Muller</a> for explaining this all to me.</p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_VerticalLayout_getScrollPositionDeltaToElement_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.core.IVisualElement;</span>
<span style="color: #000000;">            import spark.layouts.VerticalLayout;</span>
&nbsp;
<span style="color: #000000;">            protected function textinput_focusInHandler<span style="color: #66cc66;">&#40;</span>evt:FocusEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var idx:int = vg.getElementIndex<span style="color: #66cc66;">&#40;</span>evt.currentTarget as IVisualElement<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var lay:VerticalLayout = vg.layout as VerticalLayout;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>lay.fractionOfElementInView<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    lay.verticalScrollPosition += lay.getScrollPositionDeltaToElement<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span>.y;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Scroller</span> id=<span style="color: #ff0000;">&quot;scrllr&quot;</span></span>
<span style="color: #000000;">            focusEnabled=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            hasFocusableChildren=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> id=<span style="color: #ff0000;">&quot;vg&quot;</span></span>
<span style="color: #000000;">                paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Three&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Four&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Five&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Six&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Seven&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Eight&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Nine&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>If you wanted to add a little scrolling animation (&#8217;cause who <em>DOESN&#8217;T</em> love animation!?), you could use an Animate with a SimpleMotionPath, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_VerticalLayout_getScrollPositionDeltaToElement_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.core.IVisualElement;</span>
<span style="color: #000000;">            import spark.layouts.VerticalLayout;</span>
&nbsp;
<span style="color: #000000;">            protected function textinput_focusInHandler<span style="color: #66cc66;">&#40;</span>evt:FocusEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var idx:int = vg.getElementIndex<span style="color: #66cc66;">&#40;</span>evt.currentTarget as IVisualElement<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var lay:VerticalLayout = vg.layout as VerticalLayout;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>lay.fractionOfElementInView<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    pth.valueBy = lay.getScrollPositionDeltaToElement<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span>.y;</span>
<span style="color: #000000;">                    anim.play<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>lay<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Animate</span> id=<span style="color: #ff0000;">&quot;anim&quot;</span> duration=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:motionPaths</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleMotionPath</span> id=<span style="color: #ff0000;">&quot;pth&quot;</span> property=<span style="color: #ff0000;">&quot;verticalScrollPosition&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:motionPaths</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Animate</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Scroller</span> id=<span style="color: #ff0000;">&quot;scrllr&quot;</span></span>
<span style="color: #000000;">            focusEnabled=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            hasFocusableChildren=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> id=<span style="color: #ff0000;">&quot;vg&quot;</span></span>
<span style="color: #000000;">                paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Three&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Four&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Five&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Six&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Seven&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Eight&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Nine&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Auto scrolling the contents of a VGroup container in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/',contentID: 'post-2136',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fractionOfElementInView(),getElementIndex(),getScrollPositionDeltaToElement(),Gumbo,layout,verticalScrollPosition',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using an easing function with the AnimateProperties class in Flex and Flash Player 10</title>
		<link>http://blog.flexexamples.com/2008/08/12/using-an-easing-function-with-the-animateproperties-class-in-flex-and-flash-player-10/</link>
		<comments>http://blog.flexexamples.com/2008/08/12/using-an-easing-function-with-the-animateproperties-class-in-flex-and-flash-player-10/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 13:47:03 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[AnimateProperties]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[duration]]></category>
		<category><![CDATA[easingFunction]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/12/using-an-easing-function-with-the-animateproperties-class-in-flex-and-flash-player-10/</guid>
		<description><![CDATA[<p>The following example shows how you can apply an easing function to a property animation in Flex with the beta Gumbo SDK and Flash Player 10 by setting the easingFunction property on the AnimateProperties object instance.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can apply an easing function to a property animation in Flex with the beta Gumbo SDK and Flash Player 10 by setting the <code>easingFunction</code> property on the AnimateProperties object instance.</p>
<p>Full code after the jump.</p>
<p><span id="more-742"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_easingFunction_test/bin/srcview/source/main1.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/12/using-an-easing-function-with-the-animateproperties-class-in-flex-and-flash-player-10/ --&gt;
&lt;Application name="AnimateProperties_easingFunction_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library:adobe/flex/halo"
        layout="flex.layout.BasicLayout"&gt;

    &lt;Declarations&gt;
        &lt;AnimateProperties id="animateProps"
                easingFunction="Elastic.easeOut"
                duration="4000"&gt;
            &lt;propertyValuesList&gt;
                &lt;PropertyValuesHolder property="rotationY"
                        values="[0, 360]" /&gt;
            &lt;/propertyValuesList&gt;
        &lt;/AnimateProperties&gt;
    &lt;/Declarations&gt;

    &lt;Script&gt;
        import mx.effects.easing.*;

        private function animateRotationY():void {
            animateProps.stop();
            animateProps.play([img]);
        }
    &lt;/Script&gt;

    &lt;Button label="Rotate y-axis"
            top="10"
            left="10"
            click="animateRotationY();" /&gt;

    &lt;mx:Image id="img"
            source="@Embed('Fx.png')"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_easingFunction_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_easingFunction_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>You can also set the <code>easingFunction</code> property in ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_easingFunction_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/12/using-an-easing-function-with-the-animateproperties-class-in-flex-and-flash-player-10/ --&gt;
&lt;Application name="AnimateProperties_easingFunction_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library:adobe/flex/halo"
        layout="flex.layout.BasicLayout"
        initialize="init();"&gt;

    &lt;Script&gt;
        import flex.effects.AnimateProperties;
        import flex.effects.PropertyValuesHolder;
        import mx.effects.easing.*;

        private var animateProps:AnimateProperties;

        private function init():void {
            var rotYProp:PropertyValuesHolder;
            rotYProp = new PropertyValuesHolder("rotationY", [0, 360]);
            animateProps = new AnimateProperties();
            animateProps.easingFunction = Elastic.easeOut;
            animateProps.duration = 4000; // ms
            animateProps.propertyValuesList = [rotYProp];
        }

        private function animateRotationY():void {
            animateProps.stop();
            animateProps.play([img]);
        }
    &lt;/Script&gt;

    &lt;Button label="Rotate y-axis"
            top="10"
            left="10"
            click="animateRotationY();" /&gt;

    &lt;mx:Image id="img"
            source="@Embed('Fx.png')"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using an easing function with the AnimateProperties class in Flex and Flash Player 10 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/12/using-an-easing-function-with-the-animateproperties-class-in-flex-and-flash-player-10/',contentID: 'post-742',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'duration,easingFunction,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/12/using-an-easing-function-with-the-animateproperties-class-in-flex-and-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repeating an animation using the AnimateProperties class in Flex and Flash Player 10</title>
		<link>http://blog.flexexamples.com/2008/08/12/repeating-an-animation-using-the-animateproperties-class-in-flex-and-flash-player-10/</link>
		<comments>http://blog.flexexamples.com/2008/08/12/repeating-an-animation-using-the-animateproperties-class-in-flex-and-flash-player-10/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 07:34:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[AnimateProperties]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[repeatCount]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/12/repeating-an-animation-using-the-animateproperties-class-in-flex-and-flash-player-10/</guid>
		<description><![CDATA[<p>The following example shows how you can repeat a property animation in Flex with the beta Gumbo SDK and Flash Player 10 using the AnimateProperties class and repeatCount property.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can repeat a property animation in Flex with the beta Gumbo SDK and Flash Player 10 using the AnimateProperties class and <code>repeatCount</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-741"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_repeatCount_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/12/repeating-an-animation-using-the-animateproperties-class-in-flex-and-flash-player-10/ --&gt;
&lt;Application xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library:adobe/flex/halo"
        layout="flex.layout.BasicLayout"&gt;

    &lt;Declarations&gt;
        &lt;AnimateProperties id="animateProps"
                repeatCount="{numericStepper.value}"&gt;
            &lt;propertyValuesList&gt;
                &lt;PropertyValuesHolder property="rotationY"
                        values="[0, 360]" /&gt;
            &lt;/propertyValuesList&gt;
        &lt;/AnimateProperties&gt;
    &lt;/Declarations&gt;

    &lt;Script&gt;
        private function animateRotationY():void {
            animateProps.stop();
            animateProps.play([img]);
        }
    &lt;/Script&gt;

    &lt;mx:HBox top="10" left="10"&gt;
        &lt;mx:NumericStepper id="numericStepper"
                minimum="0"
                maximum="10"
                value="1" /&gt;
        &lt;Button label="Rotate y-axis"
                click="animateRotationY();" /&gt;
    &lt;/mx:HBox&gt;

    &lt;mx:Image id="img"
            source="@Embed('Fx.png')"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_repeatCount_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_repeatCount_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>You can also set the <code>repeatCount</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_repeatCount_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/12/repeating-an-animation-using-the-animateproperties-class-in-flex-and-flash-player-10/ --&gt;
&lt;Application xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library:adobe/flex/halo"
        layout="flex.layout.BasicLayout"
        initialize="init();"&gt;

    &lt;Script&gt;
        import flex.effects.AnimateProperties;
        import flex.effects.PropertyValuesHolder;

        private var animateProps:AnimateProperties;

        private function init():void {
            var rotYProp:PropertyValuesHolder;
            rotYProp = new PropertyValuesHolder("rotationY", [0, 360]);
            animateProps = new AnimateProperties();
            animateProps.propertyValuesList = [rotYProp];
        }

        private function animateRotationY():void {
            animateProps.stop();
            animateProps.repeatCount = numericStepper.value;
            animateProps.play([img]);
        }
    &lt;/Script&gt;

    &lt;mx:HBox top="10" left="10"&gt;
        &lt;mx:NumericStepper id="numericStepper"
                minimum="0"
                maximum="10"
                value="1" /&gt;
        &lt;Button label="Rotate y-axis"
                click="animateRotationY();" /&gt;
    &lt;/mx:HBox&gt;

    &lt;mx:Image id="img"
            source="@Embed('Fx.png')"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Repeating an animation using the AnimateProperties class in Flex and Flash Player 10 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/12/repeating-an-animation-using-the-animateproperties-class-in-flex-and-flash-player-10/',contentID: 'post-741',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,repeatCount',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/12/repeating-an-animation-using-the-animateproperties-class-in-flex-and-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Animating properties using the AnimateProperties class in Flex and Flash Player 10</title>
		<link>http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/</link>
		<comments>http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 14:31:41 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[AnimateProperties]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[PropertyValuesHolder]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[propertyValuesList]]></category>
		<category><![CDATA[rotationY]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/</guid>
		<description><![CDATA[<p>In a previous entry, <a href="http://blog.flexexamples.com/2008/08/02/rotating-an-image-along-its-x-axis-y-axis-and-z-axis-in-flex-and-flash-player-10/">&#8220;Rotating an image along its x-axis, y-axis, and z-axis in Flex and Flash Player 10&#8243;</a>, we saw how you could rotate an image along the x-axis, y-axis, and z-axis by setting the rotationX, rotationY, and rotationZ properties.</p> <p>The following example shows how you can use the new new AnimateProperties class [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous entry, <a href="http://blog.flexexamples.com/2008/08/02/rotating-an-image-along-its-x-axis-y-axis-and-z-axis-in-flex-and-flash-player-10/">&#8220;Rotating an image along its x-axis, y-axis, and z-axis in Flex and Flash Player 10&#8243;</a>, we saw how you could rotate an image along the x-axis, y-axis, and z-axis by setting the <code>rotationX</code>, <code>rotationY</code>, and <code>rotationZ</code> properties.</p>
<p>The following example shows how you can use the new new AnimateProperties class to rotate of an image along the y-axis by animating the <code>rotationY</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-740"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_play_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/ --&gt;
&lt;Application xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library:adobe/flex/halo"
        layout="flex.layout.BasicLayout"&gt;

    &lt;Declarations&gt;
        &lt;AnimateProperties id="animateProps"&gt;
            &lt;propertyValuesList&gt;
                &lt;PropertyValuesHolder property="rotationY"
                        values="[0, 360]" /&gt;
            &lt;/propertyValuesList&gt;
        &lt;/AnimateProperties&gt;
    &lt;/Declarations&gt;

    &lt;Script&gt;
        private function animateRotationY():void {
            animateProps.play([img]);
        }
    &lt;/Script&gt;

    &lt;Button label="Rotate y-axis"
            top="10"
            left="10"
            click="animateRotationY();" /&gt;

    &lt;mx:Image id="img"
            source="@Embed('Fx.png')"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_play_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_play_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>You can also create the AnimateProperties object using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/AnimateProperties_play_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/ --&gt;
&lt;Application xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library:adobe/flex/halo"
        layout="flex.layout.BasicLayout"
        initialize="init();"&gt;

    &lt;Script&gt;
        import flex.effects.AnimateProperties;
        import flex.effects.PropertyValuesHolder;

        private var animateProps:AnimateProperties;

        private function init():void {
            var rotYProp:PropertyValuesHolder;
            rotYProp = new PropertyValuesHolder("rotationY", [0, 360]);
            animateProps = new AnimateProperties();
            animateProps.propertyValuesList = [rotYProp];
        }

        private function animateRotationY():void {
            animateProps.play([img]);
        }
    &lt;/Script&gt;

    &lt;Button label="Rotate y-axis"
            top="10"
            left="10"
            click="animateRotationY();" /&gt;

    &lt;mx:Image id="img"
            source="@Embed('Fx.png')"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/Application&gt;
</pre>
<p class="new">You can also specify the target to animate in the &lt;AnimateProperties /&gt; tag, as seen in the following example:</p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/ --&gt;
&lt;Application xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;
        xmlns:mx=&quot;library:adobe/flex/halo&quot;
        layout=&quot;flex.layout.BasicLayout&quot;&gt;

    &lt;Declarations&gt;
        &lt;AnimateProperties id=&quot;animateProps&quot; <strong style="color:red;">target=&quot;{img}&quot;</strong>&gt;
            &lt;propertyValuesList&gt;
                &lt;PropertyValuesHolder property=&quot;rotationY&quot;
                        values=&quot;[0, 360]&quot; /&gt;
            &lt;/propertyValuesList&gt;
        &lt;/AnimateProperties&gt;
    &lt;/Declarations&gt;

    &lt;Script&gt;
        private function animateRotationY():void {
            <strong style="color:red;">animateProps.play();</strong>
        }
    &lt;/Script&gt;

    &lt;Button label=&quot;Rotate y-axis&quot;
            top=&quot;10&quot;
            left=&quot;10&quot;
            click=&quot;animateRotationY();&quot; /&gt;

    &lt;mx:Image id=&quot;img&quot;
            source=&quot;@Embed('Fx.png')&quot;
            width=&quot;100&quot;
            height=&quot;100&quot;
            horizontalCenter=&quot;0&quot;
            verticalCenter=&quot;0&quot; /&gt;

&lt;/Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Animating properties using the AnimateProperties class in Flex and Flash Player 10 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/',contentID: 'post-740',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,propertyValuesList,rotationY',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/11/animating-properties-using-the-animateproperties-class-in-flex-and-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

