<?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; Effects</title>
	<atom:link href="http://blog.flexexamples.com/category/effects/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>Creating blinking text on a Spark RichText control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 21:09:54 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Effects]]></category>
		<category><![CDATA[Flex4]]></category>
		<category><![CDATA[RichText (Spark)]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[Animate]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[SimpleMotionPath]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3239</guid>
		<description><![CDATA[<p>The following example shows how you can create a blinking text effect on a Spark RichText control in Flex 4 using a simple property animation with the Animate and SimpleMotionPath classes to tween the alpha property.</p> <p></p> <p class="alert">I&#8217;d like to dedicate this post to the two people that searched for this on my blog [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a blinking text effect on a Spark RichText control in Flex 4 using a simple property animation with the Animate and SimpleMotionPath classes to tween the <code>alpha</code> property.</p>
<p><span id="more-3239"></span></p>
<p class="alert">I&#8217;d like to dedicate this post to the two people that searched for this on my blog (who may be the only people to want to bring back the old HTML blinking text effect).</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/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-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_RichText_blink_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>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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;fader&quot;</span></span>
<span style="color: #000000;">                duration=<span style="color: #ff0000;">&quot;500&quot;</span></span>
<span style="color: #000000;">                repeatBehavior=<span style="color: #ff0000;">&quot;reverse&quot;</span></span>
<span style="color: #000000;">                repeatCount=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                target=<span style="color: #ff0000;">&quot;{lbl}&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleMotionPath</span> property=<span style="color: #ff0000;">&quot;alpha&quot;</span></span>
<span style="color: #000000;">                    valueFrom=<span style="color: #ff0000;">&quot;1.0&quot;</span> valueTo=<span style="color: #ff0000;">&quot;0.0&quot;</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:Label</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span></span>
<span style="color: #000000;">            text=<span style="color: #ff0000;">&quot;BLINKING TEXT, I HATE YOU!&quot;</span></span>
<span style="color: #000000;">            color=<span style="color: #ff0000;">&quot;red&quot;</span></span>
<span style="color: #000000;">            fontSize=<span style="color: #ff0000;">&quot;32&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;fader.play();&quot;</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: 'Creating blinking text on a Spark RichText control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-in-flex-4/',contentID: 'post-3239',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'alpha,Animate,Gumbo,SimpleMotionPath',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/2010/08/13/creating-blinking-text-on-a-spark-richtext-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Creating a simple property animation in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/04/22/creating-a-simple-property-animation-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/04/22/creating-a-simple-property-animation-in-flex-4/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 22:11:58 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Effects]]></category>
		<category><![CDATA[Flex4]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[play()]]></category>
		<category><![CDATA[playReversedFromEnd]]></category>
		<category><![CDATA[valueFrom]]></category>
		<category><![CDATA[valueTo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2848</guid>
		<description><![CDATA[<p>The following example shows how you can create a simple property animation in Flex 4 using the Animate and SimpleMotionPath classes and the play() method.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/04/22/creating-a-simple-property-animation-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_Animate_SimpleMotionPath_play_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#60;s:controlBarContent&#62; &#60;s:Button id=&#34;btn1&#34; label=&#34;play forward&#34; click=&#34;anim.play();&#34; /&#62; &#60;s:Button id=&#34;btn2&#34; label=&#34;play reversed from end&#34; click=&#34;anim.play(null, true);&#34; /&#62; &#60;/s:controlBarContent&#62; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a simple property animation in Flex 4 using the Animate and SimpleMotionPath classes and the <code>play()</code> method.</p>
<p><span id="more-2848"></span></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/2010/04/22/creating-a-simple-property-animation-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_Animate_SimpleMotionPath_play_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>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn1&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;play forward&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;anim.play();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn2&quot;</span> </span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;play reversed from end&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;anim.play(null, true);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</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> targets=<span style="color: #ff0000;">&quot;{[img]}&quot;</span> duration=<span style="color: #ff0000;">&quot;1000&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleMotionPath</span> property=<span style="color: #ff0000;">&quot;alpha&quot;</span> valueFrom=<span style="color: #ff0000;">&quot;0.0&quot;</span> valueTo=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleMotionPath</span> property=<span style="color: #ff0000;">&quot;horizontalCenter&quot;</span> valueFrom=<span style="color: #ff0000;">&quot;-100&quot;</span> valueTo=<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:SimpleMotionPath</span> property=<span style="color: #ff0000;">&quot;rotationY&quot;</span> valueFrom=<span style="color: #ff0000;">&quot;-45&quot;</span> valueTo=<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:SimpleMotionPath</span> property=<span style="color: #ff0000;">&quot;scaleX&quot;</span> valueFrom=<span style="color: #ff0000;">&quot;1.5&quot;</span> valueTo=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleMotionPath</span> property=<span style="color: #ff0000;">&quot;scaleY&quot;</span> valueFrom=<span style="color: #ff0000;">&quot;1.5&quot;</span> valueTo=<span style="color: #ff0000;">&quot;1&quot;</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:BitmapImage</span> id=<span style="color: #ff0000;">&quot;img&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;@Embed('assets/flex_100x100.jpg')&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>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_Animate_SimpleMotionPath_play_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_Animate_SimpleMotionPath_play_test/main.html" width="100%" height="300"></iframe></p>
<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: 'Creating a simple property animation in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/04/22/creating-a-simple-property-animation-in-flex-4/',contentID: 'post-2848',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,play(),playReversedFromEnd,valueFrom,valueTo',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/2010/04/22/creating-a-simple-property-animation-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Animating colors using the FxAnimateColor effect in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 06:59:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[FxAnimateColor]]></category>
		<category><![CDATA[colorFrom]]></category>
		<category><![CDATA[colorTo]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can create an animated transition between two colors using the Flex Gumbo FxAnimateColor class.</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 Flex Builder 3. For more information on downloading and [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create an animated transition between two colors using the Flex Gumbo FxAnimateColor class.</p>
<p>Full code after the jump.</p>
<p><span id="more-860"></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/FxAnimateColor_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/ --&gt;
&lt;FxApplication name=&quot;FxAnimateColor_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;&gt;

    &lt;Declarations&gt;
        &lt;FxAnimateColor id=&quot;fxAnimateColor&quot;
                colorFrom=&quot;{color1.selectedColor}&quot;
                colorTo=&quot;{color2.selectedColor}&quot;
                target=&quot;{ellipse.fill}&quot; /&gt;
    &lt;/Declarations&gt;

    &lt;Form&gt;
        &lt;FormItem label=&quot;colorFrom:&quot;&gt;
            &lt;ColorPicker id=&quot;color1&quot;
                    selectedColor=&quot;red&quot; /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label=&quot;colorTo:&quot;&gt;
            &lt;ColorPicker id=&quot;color2&quot;
                    selectedColor=&quot;blue&quot; /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem&gt;
            &lt;Button id=&quot;btn&quot;
                    label=&quot;Play&quot;
                    click=&quot;fxAnimateColor.play();&quot; /&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id=&quot;ellipse&quot;
            width=&quot;300&quot;
            height=&quot;200&quot;
            horizontalCenter=&quot;0&quot;
            verticalCenter=&quot;0&quot;&gt;
        &lt;fill&gt;
            &lt;SolidColor /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxAnimateColor_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/FxAnimateColor_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxAnimateColor_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/ --&gt;
&lt;FxApplication name=&quot;FxAnimateColor_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;
        initialize=&quot;init();&quot;&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.Button;
            import mx.controls.ColorPicker;
            import mx.effects.FxAnimateColor;
            import mx.events.ColorPickerEvent;
            import mx.graphics.Ellipse;
            import mx.graphics.SolidColor;

            private var btn:Button;
            private var color1:ColorPicker;
            private var color2:ColorPicker;
            private var ellipse:Ellipse;
            private var fxAnimateColor:FxAnimateColor;

            private function init():void {
                color1 = new ColorPicker();
                color1.selectedColor = 0xFF0000; // red;
                color1.addEventListener(ColorPickerEvent.CHANGE, color1_change);

                color2 = new ColorPicker();
                color2.selectedColor = 0x0000FF; // blue
                color2.addEventListener(ColorPickerEvent.CHANGE, color2_change);

                btn = new Button();
                btn.label = &quot;Play&quot;;
                btn.addEventListener(MouseEvent.CLICK, btn_click);

                var formItem1:FormItem = new FormItem();
                formItem1.label = &quot;colorFrom:&quot;;
                formItem1.addChild(color1);

                var formItem2:FormItem = new FormItem();
                formItem2.label = &quot;colorTo:&quot;;
                formItem2.addChild(color2);

                var formItem3:FormItem = new FormItem();
                formItem2.addChild(btn);

                var form:Form = new Form();
                form.addChild(formItem1);
                form.addChild(formItem2);
                form.addChild(formItem3);
                addItem(form);

                ellipse = new Ellipse();
                ellipse.fill = new SolidColor();
                ellipse.width = 300;
                ellipse.height = 200;
                ellipse.horizontalCenter = 0;
                ellipse.verticalCenter = 0;
                addItem(ellipse);

                fxAnimateColor = new FxAnimateColor();
                fxAnimateColor.colorFrom = color1.selectedColor;
                fxAnimateColor.colorTo = color2.selectedColor;
                fxAnimateColor.target = ellipse.fill;
            }

            private function color1_change(evt:ColorPickerEvent):void {
                fxAnimateColor.colorFrom = evt.color;
            }

            private function color2_change(evt:ColorPickerEvent):void {
                fxAnimateColor.colorTo = evt.color;
            }

            private function btn_click(evt:MouseEvent):void {
                fxAnimateColor.play();
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/FxApplication&gt;
</pre>
<p class="new">You can also just specify the <code>colorTo</code> property if you want to animate from the current color to a specific color:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxAnimateColor_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/ --&gt;
&lt;FxApplication name=&quot;FxAnimateColor_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;&gt;

    &lt;Declarations&gt;
        &lt;FxAnimateColor id=&quot;fxAnimateColor&quot;
                colorTo=&quot;{color2.selectedColor}&quot;
                target=&quot;{ellipse.fill}&quot; /&gt;
    &lt;/Declarations&gt;

    &lt;Form&gt;
        &lt;FormItem label=&quot;colorTo:&quot;&gt;
            &lt;ColorPicker id=&quot;color2&quot;
                    selectedColor=&quot;blue&quot; /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem&gt;
            &lt;Button id=&quot;btn&quot;
                    label=&quot;Play&quot;
                    click=&quot;fxAnimateColor.play();&quot; /&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id=&quot;ellipse&quot;
            width=&quot;300&quot;
            height=&quot;200&quot;
            horizontalCenter=&quot;0&quot;
            verticalCenter=&quot;0&quot;&gt;
        &lt;fill&gt;
            &lt;SolidColor /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxAnimateColor_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/FxAnimateColor_test/bin/main3.html" width="100%" height="300"></iframe></p>
<p class="alert">This entry is based on a beta version of the Flex Gumbo 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 Gumbo SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Animating colors using the FxAnimateColor effect in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/',contentID: 'post-860',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'colorFrom,colorTo,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/11/06/animating-colors-using-the-fxanimatecolor-effect-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Incrementally 3D rotating objects using the Spark Rotate3D effect in Flex 4</title>
		<link>http://blog.flexexamples.com/2008/10/25/incrementally-3d-rotating-objects-in-flex-using-the-fxrotate3d-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/10/25/incrementally-3d-rotating-objects-in-flex-using-the-fxrotate3d-in-flex/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 06:48:28 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[FxRotate3D]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[isPlaying]]></category>
		<category><![CDATA[needsSWF]]></category>
		<category><![CDATA[yBy]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/25/incrementally-3d-rotating-objects-in-flex-using-the-fxrotate3d-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/">&#8220;3D Rotating objects in Flex 4 using the Spark Rotate3D effect and Flash Player 10&#8243;</a>, we saw how you could rotate objects in 3D space from 0 to 360 degrees along the X, Y, and Z axis using the Spark Rotate3D effect in the Flex 4 SDK.</p> <p>The following example [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/">&#8220;3D Rotating objects in Flex 4 using the Spark Rotate3D effect and Flash Player 10&#8243;</a>, we saw how you could rotate objects in 3D space from 0 to 360 degrees along the X, Y, and Z axis using the Spark Rotate3D effect in the Flex 4 SDK.</p>
<p>The following example shows how you can rotate an image relative to its current rotation by setting the <code>yBy</code> property on the Spark Rotate3D instance.</p>
<p>Full code after the jump.</p>
<p><span id="more-842"></span></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/2008/10/25/incrementally-3d-rotating-objects-in-flex-using-the-fxrotate3d-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Rotate3D_yBy_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>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BasicLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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.events.FlexEvent;</span>
<span style="color: #000000;">            import spark.effects.Animate;</span>
&nbsp;
<span style="color: #000000;">            private function playEffect<span style="color: #66cc66;">&#40;</span>target:Animate, angle:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!target.isPlaying<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    rotY += angle;</span>
<span style="color: #000000;">                    target.play<span style="color: #66cc66;">&#40;</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;fx:Number</span> id=<span style="color: #ff0000;">&quot;rotY&quot;</span><span style="color: #7400FF;">&gt;</span></span>0<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Number</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rotate</span>3D id=<span style="color: #ff0000;">&quot;fxRotate3DNeg&quot;</span> target=<span style="color: #ff0000;">&quot;{image}&quot;</span> angleYTo=<span style="color: #ff0000;">&quot;{rotY}&quot;</span> autoCenterTransform=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rotate</span>3D id=<span style="color: #ff0000;">&quot;fxRotate3DPos&quot;</span> target=<span style="color: #ff0000;">&quot;{image}&quot;</span> angleYTo=<span style="color: #ff0000;">&quot;{rotY}&quot;</span> autoCenterTransform=<span style="color: #ff0000;">&quot;true&quot;</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:VGroup</span> id=<span style="color: #ff0000;">&quot;vGroup&quot;</span> left=<span style="color: #ff0000;">&quot;10&quot;</span> top=<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:Button</span> id=<span style="color: #ff0000;">&quot;fxButtonNeg&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Rotate3D (angleYTo - 30)&quot;</span></span>
<span style="color: #000000;">                autoRepeat=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                repeatDelay=<span style="color: #ff0000;">&quot;500&quot;</span></span>
<span style="color: #000000;">                repeatInterval=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">                buttonDown=<span style="color: #ff0000;">&quot;playEffect(fxRotate3DNeg, -30);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;fxButtonPos&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Rotate3D (angleYTo + 30)&quot;</span></span>
<span style="color: #000000;">                autoRepeat=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                repeatDelay=<span style="color: #ff0000;">&quot;500&quot;</span></span>
<span style="color: #000000;">                repeatInterval=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">                buttonDown=<span style="color: #ff0000;">&quot;playEffect(fxRotate3DNeg, 30);&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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> id=<span style="color: #ff0000;">&quot;image&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;@Embed('assets/fx_appicon-tn.gif')&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</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="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxRotate3D_yBy_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/FxRotate3D_yBy_test/bin/main.html" width="100%" height="300"></iframe></p>
<p><!--<br />
Due to popular demand, here is the "same" example in a more ActionScript friendly format:</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: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Rotate3D_yBy_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>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BasicLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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 spark.primitives.BitmapImage;</span>
<span style="color: #000000;">            import spark.components.Button;</span>
<span style="color: #000000;">            import spark.components.VGroup;</span>
<span style="color: #000000;">            import spark.effects.Animate;</span>
<span style="color: #000000;">            import spark.effects.Rotate3D;</span>
<span style="color: #000000;">            import mx.events.FlexEvent;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;assets/fx_appicon-tn.gif&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private const LOGO:Class;</span>
&nbsp;
<span style="color: #000000;">            private var fxRotate3DNeg:Rotate3D;</span>
<span style="color: #000000;">            private var fxRotate3DPos:Rotate3D;</span>
<span style="color: #000000;">            private var fxButtonNeg:Button;</span>
<span style="color: #000000;">            private var fxButtonPos:Button;</span>
<span style="color: #000000;">            private var image:BitmapImage;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                fxButtonNeg = new Button<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxButtonNeg.label=<span style="color: #ff0000;">&quot;Rotate3D yBy -= 15&quot;</span>;</span>
<span style="color: #000000;">                fxButtonNeg.autoRepeat = true;</span>
<span style="color: #000000;">                fxButtonNeg.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;repeatDelay&quot;</span>, <span style="color: #cc66cc;">500</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxButtonNeg.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;repeatInterval&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxButtonNeg.addEventListener<span style="color: #66cc66;">&#40;</span>FlexEvent.BUTTON_DOWN,</span>
<span style="color: #000000;">                            fxButtonNeg_buttonDown<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                fxButtonPos = new Button<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxButtonPos.label=<span style="color: #ff0000;">&quot;Rotate3D yBy += 15&quot;</span>;</span>
<span style="color: #000000;">                fxButtonPos.autoRepeat = true;</span>
<span style="color: #000000;">                fxButtonPos.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;repeatDelay&quot;</span>, <span style="color: #cc66cc;">500</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxButtonPos.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;repeatInterval&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxButtonPos.addEventListener<span style="color: #66cc66;">&#40;</span>FlexEvent.BUTTON_DOWN,</span>
<span style="color: #000000;">                            fxButtonPos_buttonDown<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var vGroup:VGroup = new VGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGroup.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;left&quot;</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGroup.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;top&quot;</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGroup.addElement<span style="color: #66cc66;">&#40;</span>fxButtonNeg<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGroup.addElement<span style="color: #66cc66;">&#40;</span>fxButtonPos<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>vGroup<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                image = new BitmapImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                image.source = LOGO;</span>
<span style="color: #000000;">                image.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                image.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>image<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                fxRotate3DNeg = new Rotate3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxRotate3DNeg.target = image;</span>
<span style="color: #000000;">                fxRotate3DNeg.yBy = -<span style="color: #cc66cc;">30</span>;</span>
&nbsp;
<span style="color: #000000;">                fxRotate3DPos = new Rotate3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                fxRotate3DPos.target = image;</span>
<span style="color: #000000;">                fxRotate3DPos.yBy = <span style="color: #cc66cc;">30</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function fxButtonNeg_buttonDown<span style="color: #66cc66;">&#40;</span>evt:FlexEvent<span style="color: #66cc66;">&#41;</span>:void<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                playEffect<span style="color: #66cc66;">&#40;</span>fxRotate3DNeg<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function fxButtonPos_buttonDown<span style="color: #66cc66;">&#40;</span>evt:FlexEvent<span style="color: #66cc66;">&#41;</span>:void<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                playEffect<span style="color: #66cc66;">&#40;</span>fxRotate3DPos<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function playEffect<span style="color: #66cc66;">&#40;</span>target:Animate<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!target.isPlaying<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    target.play<span style="color: #66cc66;">&#40;</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;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>&#8211;><br />
<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></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Incrementally 3D rotating objects using the Spark Rotate3D effect in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/25/incrementally-3d-rotating-objects-in-flex-using-the-fxrotate3d-in-flex/',contentID: 'post-842',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,isPlaying,needsSWF,yBy',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/10/25/incrementally-3d-rotating-objects-in-flex-using-the-fxrotate3d-in-flex/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>3D Rotating objects in Flex 4 using the Rotate3D effect and Flash Player 10</title>
		<link>http://blog.flexexamples.com/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/</link>
		<comments>http://blog.flexexamples.com/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 13:56:49 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Rotate3D (Spark)]]></category>
		<category><![CDATA[angleXFrom]]></category>
		<category><![CDATA[angleXTo]]></category>
		<category><![CDATA[angleYFrom]]></category>
		<category><![CDATA[angleYTo]]></category>
		<category><![CDATA[angleZFrom]]></category>
		<category><![CDATA[angleZTo]]></category>
		<category><![CDATA[autoCenterTransform]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/</guid>
		<description><![CDATA[<p>The following example shows how you can rotate objects in 3D space using the Flex Rotate3D effect using the latest version (build 4.0.0.8811) of the beta Flex 4 SDK.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/ --&#62; &#60;s:Application name=&#34;Spark_Rotate3D_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/halo&#34;&#62; &#60;s:layout&#62; &#60;s:BasicLayout /&#62; &#60;/s:layout&#62; &#160; &#60;fx:Declarations&#62; &#60;s:Rotate3D id=&#34;rotate3DX&#34; target=&#34;{image}&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can rotate objects in 3D space using the Flex Rotate3D effect using the latest version (build 4.0.0.8811) of the beta Flex 4 SDK.</p>
<p>Full code after the jump.</p>
<p><span id="more-829"></span></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/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Rotate3D_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>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BasicLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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:Rotate</span>3D id=<span style="color: #ff0000;">&quot;rotate3DX&quot;</span></span>
<span style="color: #000000;">                target=<span style="color: #ff0000;">&quot;{image}&quot;</span></span>
<span style="color: #000000;">                angleXFrom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                angleXTo=<span style="color: #ff0000;">&quot;360&quot;</span></span>
<span style="color: #000000;">                duration=<span style="color: #ff0000;">&quot;2000&quot;</span></span>
<span style="color: #000000;">                autoCenterTransform=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rotate</span>3D id=<span style="color: #ff0000;">&quot;rotate3DY&quot;</span></span>
<span style="color: #000000;">                target=<span style="color: #ff0000;">&quot;{image}&quot;</span></span>
<span style="color: #000000;">                angleYFrom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                angleYTo=<span style="color: #ff0000;">&quot;360&quot;</span></span>
<span style="color: #000000;">                duration=<span style="color: #ff0000;">&quot;2000&quot;</span></span>
<span style="color: #000000;">                autoCenterTransform=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rotate</span>3D id=<span style="color: #ff0000;">&quot;rotate3DZ&quot;</span></span>
<span style="color: #000000;">                target=<span style="color: #ff0000;">&quot;{image}&quot;</span></span>
<span style="color: #000000;">                angleZFrom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                angleZTo=<span style="color: #ff0000;">&quot;360&quot;</span></span>
<span style="color: #000000;">                duration=<span style="color: #ff0000;">&quot;2000&quot;</span></span>
<span style="color: #000000;">                autoCenterTransform=<span style="color: #ff0000;">&quot;true&quot;</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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<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:Button</span> id=<span style="color: #ff0000;">&quot;buttonX&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Rotate3D X-axis&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;rotate3DX.play();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;buttonY&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Rotate3D Y-axis&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;rotate3DY.play();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;bButtonZ&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Rotate3D Z-axis&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;rotate3DZ.play();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> id=<span style="color: #ff0000;">&quot;image&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;@Embed('assets/fx_appicon.jpg')&quot;</span></span>
<span style="color: #000000;">            resizeMode=<span style="color: #ff0000;">&quot;scale&quot;</span></span>
<span style="color: #000000;">            smooth=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;100&quot;</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="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_Rotate3D_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_Rotate3D_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</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/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Rotate3D_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>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BasicLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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.containers.ApplicationControlBar;</span>
<span style="color: #000000;">            import spark.components.Button;</span>
<span style="color: #000000;">            import spark.components.ResizeMode;</span>
<span style="color: #000000;">            import spark.primitives.BitmapImage;</span>
<span style="color: #000000;">            import spark.effects.Rotate3D;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;assets/fx_appicon.jpg&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private const FlexLogo:Class;</span>
&nbsp;
<span style="color: #000000;">            private var rotate3DX:Rotate3D;</span>
<span style="color: #000000;">            private var rotate3DY:Rotate3D;</span>
<span style="color: #000000;">            private var rotate3DZ:Rotate3D;</span>
<span style="color: #000000;">            private var image:BitmapImage;</span>
<span style="color: #000000;">            private var buttonX:Button;</span>
<span style="color: #000000;">            private var buttonY:Button;</span>
<span style="color: #000000;">            private var buttonZ:Button;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                buttonX = new Button<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonX.label = <span style="color: #ff0000;">&quot;Rotate3D X-axis&quot;</span>;</span>
<span style="color: #000000;">                buttonX.addEventListener<span style="color: #66cc66;">&#40;</span>MouseEvent.CLICK, buttonX_click<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                buttonY = new Button<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonY.label = <span style="color: #ff0000;">&quot;Rotate3D Y-axis&quot;</span>;</span>
<span style="color: #000000;">                buttonY.addEventListener<span style="color: #66cc66;">&#40;</span>MouseEvent.CLICK, buttonY_click<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                buttonZ = new Button<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                buttonZ.label = <span style="color: #ff0000;">&quot;Rotate3D Z-axis&quot;</span>;</span>
<span style="color: #000000;">                buttonZ.addEventListener<span style="color: #66cc66;">&#40;</span>MouseEvent.CLICK, buttonZ_click<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var appControlBar:ApplicationControlBar = new ApplicationControlBar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                appControlBar.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                appControlBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;cornerRadius&quot;</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                appControlBar.addElement<span style="color: #66cc66;">&#40;</span>buttonX<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                appControlBar.addElement<span style="color: #66cc66;">&#40;</span>buttonY<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                appControlBar.addElement<span style="color: #66cc66;">&#40;</span>buttonZ<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElementAt<span style="color: #66cc66;">&#40;</span>appControlBar, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                image = new BitmapImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                image.source = FlexLogo;</span>
<span style="color: #000000;">                image.smooth = true;</span>
<span style="color: #000000;">                image.resizeMode = ResizeMode.SCALE;</span>
<span style="color: #000000;">                image.width = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                image.height = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                image.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                image.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>image<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                rotate3DX = new Rotate3D<span style="color: #66cc66;">&#40;</span>image<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                rotate3DX.angleXFrom = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                rotate3DX.angleXTo = <span style="color: #cc66cc;">360</span>;</span>
<span style="color: #000000;">                rotate3DX.duration = <span style="color: #cc66cc;">2000</span>; /* <span style="color: #cc66cc;">2</span> seconds */</span>
<span style="color: #000000;">                rotate3DX.autoCenterTransform = true;</span>
&nbsp;
<span style="color: #000000;">                rotate3DY = new Rotate3D<span style="color: #66cc66;">&#40;</span>image<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                rotate3DY.angleYFrom = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                rotate3DY.angleYTo = <span style="color: #cc66cc;">360</span>;</span>
<span style="color: #000000;">                rotate3DY.duration = <span style="color: #cc66cc;">2000</span>; /* <span style="color: #cc66cc;">2</span> seconds */</span>
<span style="color: #000000;">                rotate3DY.autoCenterTransform = true;</span>
&nbsp;
<span style="color: #000000;">                rotate3DZ = new Rotate3D<span style="color: #66cc66;">&#40;</span>image<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                rotate3DZ.angleZFrom = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                rotate3DZ.angleZTo = <span style="color: #cc66cc;">360</span>;</span>
<span style="color: #000000;">                rotate3DZ.duration = <span style="color: #cc66cc;">2000</span>; /* <span style="color: #cc66cc;">2</span> seconds */</span>
<span style="color: #000000;">                rotate3DZ.autoCenterTransform = true;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function buttonX_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                rotate3DX.play<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function buttonY_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                rotate3DY.play<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function buttonZ_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                rotate3DZ.play<span style="color: #66cc66;">&#40;</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;">&#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: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: '3D Rotating objects in Flex 4 using the Rotate3D effect and Flash Player 10 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/',contentID: 'post-829',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'angleXFrom,angleXTo,angleYFrom,angleYTo,angleZFrom,angleZTo,autoCenterTransform,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/10/13/3d-rotating-objects-in-flex-using-the-fxrotate3d-effect-and-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Applying an effect when an HBox container is resized in Flex</title>
		<link>http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 05:48:03 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Effects]]></category>
		<category><![CDATA[HBox]]></category>
		<category><![CDATA[resizeEffect]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can apply a resize effect to a Flex HBox container by setting the resizeEffect style/effect.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HBox_resizeEffect_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/ --&#62; &#60;mx:Application name="HBox_resizeEffect_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:HDividedBox id="hDividedBox" width="100%" height="100%"&#62; &#60;mx:HBox id="hBox1" backgroundColor="haloGreen" resizeEffect="Resize" width="100%" height="100%" /&#62; &#60;mx:HBox [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can apply a resize effect to a Flex HBox container by setting the <code>resizeEffect</code> style/effect.</p>
<p>Full code after the jump.</p>
<p><span id="more-814"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HBox_resizeEffect_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/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/ --&gt;
&lt;mx:Application name="HBox_resizeEffect_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:HDividedBox id="hDividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:HBox id="hBox1"
                backgroundColor="haloGreen"
                resizeEffect="Resize"
                width="100%"
                height="100%" /&gt;
        &lt;mx:HBox id="hBox2"
                backgroundColor="haloBlue"
                resizeEffect="Resize"
                width="100%"
                height="100%" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/HBox_resizeEffect_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/HBox_resizeEffect_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>resizeEffect</code> style/effect in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HBox_resizeEffect_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/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/ --&gt;
&lt;mx:Application name="HBox_resizeEffect_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        HBox {
            resizeEffect: ClassReference("mx.effects.Resize");
        }
    &lt;/mx:Style&gt;

    &lt;mx:HDividedBox id="hDividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:HBox id="hBox1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%" /&gt;
        &lt;mx:HBox id="hBox2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>resizeEffect</code> style/effect using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HBox_resizeEffect_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/ --&gt;
&lt;mx:Application name="HBox_resizeEffect_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.effects.Resize;

            private function init():void {
                hBox1.setStyle("resizeEffect", Resize);
                hBox2.setStyle("resizeEffect", Resize);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:HDividedBox id="hDividedBox"
            width="100%"
            height="100%"&gt;
        &lt;mx:HBox id="hBox1"
                backgroundColor="haloGreen"
                width="100%"
                height="100%" /&gt;
        &lt;mx:HBox id="hBox2"
                backgroundColor="haloBlue"
                width="100%"
                height="100%" /&gt;
    &lt;/mx:HDividedBox&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/HBox_resizeEffect_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/ --&gt;
&lt;mx:Application name="HBox_resizeEffect_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.HBox;
            import mx.containers.HDividedBox;
            import mx.effects.Resize;

            private var hBox1:HBox;
            private var hBox2:HBox;
            private var hDividedBox:HDividedBox;

            private function init():void {
                hBox1 = new HBox();
                hBox1.percentWidth = 100;
                hBox1.percentHeight = 100;
                hBox1.setStyle("backgroundColor", "haloGreen");
                hBox1.setStyle("resizeEffect", Resize);

                hBox2 = new HBox();
                hBox2.percentWidth = 100;
                hBox2.percentHeight = 100;
                hBox2.setStyle("backgroundColor", "haloBlue");
                hBox2.setStyle("resizeEffect", Resize);

                hDividedBox = new HDividedBox();
                hDividedBox.percentWidth = 100;
                hDividedBox.percentHeight = 100;
                hDividedBox.addChild(hBox1);
                hDividedBox.addChild(hBox2);
                addChild(hDividedBox);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Applying an effect when an HBox container is resized in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/',contentID: 'post-814',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'resizeEffect',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/10/01/applying-an-effect-when-an-hbox-container-is-resized-in-flex/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Creating a custom creation complete effect on a Flex Alert control (redux)</title>
		<link>http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/</link>
		<comments>http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 04:12:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fade]]></category>
		<category><![CDATA[Move]]></category>
		<category><![CDATA[Parallel]]></category>
		<category><![CDATA[creationCompleteEffect]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/10/12/creating-a-custom-creation-complete-effect-on-a-flex-alert-control/">&#8220;Creating a custom creation complete effect on a Flex Alert control&#8221;</a>, we saw how you could specify an effect which gets played when an Alert control is displayed by setting the Alert control&#8217;s creationCompleteEffect style.</p> <p>The following example shows how you can apply a parallel Fade/Move effect when the Alert [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/10/12/creating-a-custom-creation-complete-effect-on-a-flex-alert-control/">&#8220;Creating a custom creation complete effect on a Flex Alert control&#8221;</a>, we saw how you could specify an effect which gets played when an Alert control is displayed by setting the Alert control&#8217;s <code>creationCompleteEffect</code> style.</p>
<p>The following example shows how you can apply a parallel Fade/Move effect when the Alert control is created by setting the the <code>creationCompleteEffect</code> effect/style in MXML and ActionScript.</p>
<p>Full code after the jump.</p>
<p><span id="more-799"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/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/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/ --&gt;
&lt;mx:Application name="Alert_creationCompleteEffect_test_3"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;
            import mx.effects.easing.*;

            private function showAlert():void {
                var a:Alert = Alert.show("Nam vel nunc sed arcu fringilla fringilla. Cras dapibus nunc ut nisi.\\n" +
                        "Nullam porttitor mi et mauris.\\n" +
                        "Suspendisse hendrerit, turpis eu ornare suscipit, nulla sem tempus lorem,\\n" +
                        "sit amet semper nibh mi cursus neque.\\n" +
                        "Nulla vel purus. Sed a nulla. Quisque venenatis laoreet mi.",
                        "Lorem ipsum dolor sit amet, consectetuer adipiscing elit");
                a.isPopUp = false;
                a.cacheAsBitmap = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Verdana");
            fontFamily: VerdanaEmbedded;
        }

        @font-face {
            src: local("Verdana");
            fontFamily: VerdanaEmbedded;
            fontWeight: bold;
        }

        Alert {
            fontFamily: VerdanaEmbedded;
            creationCompleteEffect: alertCreationCompleteEffect;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Parallel id="alertCreationCompleteEffect"&gt;
        &lt;mx:Fade duration="500" /&gt;
        &lt;mx:Move yFrom="0"
                easingFunction="Elastic.easeOut"
                duration="1000" /&gt;
    &lt;/mx:Parallel&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="button"
                label="Click me"
                click="showAlert();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/bin/main.html" width="100%" height="400"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/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/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/ --&gt;
&lt;mx:Application name="Alert_creationCompleteEffect_test_3"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.controls.Alert;
            import mx.controls.Button;
            import mx.effects.easing.*;
            import mx.effects.Fade;
            import mx.effects.Move;
            import mx.effects.Parallel;

            [Embed(systemFont="Verdana",
                    fontName="VerdanaEmbedded",
                    fontWeight="normal",
                    mimeType="application/x-font")]
            private const verdanaEmbeddedNormal:Class;

            [Embed(systemFont="Verdana",
                    fontName="VerdanaEmbedded",
                    fontWeight="bold",
                    mimeType="application/x-font")]
            private const verdanaEmbeddedBold:Class;

            public var alertCreationCompleteEffect:Parallel;

            private var button:Button;

            private function init():void {
                var fader:Fade = new Fade();
                fader.duration = 500;

                var mover:Move = new Move();
                mover.yFrom = 0;
                mover.easingFunction = Elastic.easeOut;
                mover.duration = 1000;

                alertCreationCompleteEffect = new Parallel();
                alertCreationCompleteEffect.addChild(fader);
                alertCreationCompleteEffect.addChild(mover);

                button = new Button();
                button.label = "Click me";
                button.addEventListener(MouseEvent.CLICK, button_click);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(button);
                addChildAt(appControlBar, 0);

                var alertStyles:CSSStyleDeclaration;
                alertStyles = StyleManager.getStyleDeclaration("Alert");
                alertStyles.setStyle("fontFamily", "VerdanaEmbedded");
            }

            private function button_click(evt:MouseEvent):void {
                showAlert();
            }

            private function showAlert():void {
                var a:Alert = Alert.show("Nam vel nunc sed arcu fringilla fringilla. Cras dapibus nunc ut nisi.\\n" +
                        "Nullam porttitor mi et mauris.\\n" +
                        "Suspendisse hendrerit, turpis eu ornare suscipit, nulla sem tempus lorem,\\n" +
                        "sit amet semper nibh mi cursus neque.\\n" +
                        "Nulla vel purus. Sed a nulla. Quisque venenatis laoreet mi.",
                        "Lorem ipsum dolor sit amet, consectetuer adipiscing elit");
                a.setStyle("creationCompleteEffect", alertCreationCompleteEffect);
                a.isPopUp = false;
                a.cacheAsBitmap = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a custom creation complete effect on a Flex Alert control (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/',contentID: 'post-799',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'creationCompleteEffect',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/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Setting a complete effect on an Image control in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 06:51:29 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Effects]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[completeEffect]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can add a complete effect on a Flex Image control by setting the completeEffect effect using MXML, CSS, or ActionScript.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_completeEffect_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ private function button_click(evt:MouseEvent):void { image.load("assets/Fx.png"); } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can add a complete effect on a Flex Image control by setting the <code>completeEffect</code> effect using MXML, CSS, or ActionScript.</p>
<p>Full code after the jump.</p>
<p><span id="more-689"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_completeEffect_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/06/29/setting-a-complete-effect-on-an-image-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function button_click(evt:MouseEvent):void {
                image.load("assets/Fx.png");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="button"
                label="Load Image"
                click="button_click(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Image id="image"
            completeEffect="Fade"
            maintainAspectRatio="true"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_completeEffect_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/Image_completeEffect_test/bin/main.html" width="100%" height="400"></iframe></p>
<p>You can also set the <code>completeEffect</code> effect using an external .CSS file or &lt;mx:Style /&#038;gt block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_completeEffect_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function button_click(evt:MouseEvent):void {
                image.load(&quot;assets/Fx.png&quot;);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    <strong style="color:red;">&lt;mx:Style&gt;
        Image {
            completeEffect: Fade;
        }
    &lt;/mx:Style&gt;</strong>

    &lt;mx:ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;mx:Button id=&quot;button&quot;
                label=&quot;Load Image&quot;
                click=&quot;button_click(event);&quot; /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Image id=&quot;image&quot;
            maintainAspectRatio=&quot;true&quot;
            width=&quot;100%&quot;
            height=&quot;100%&quot; /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>completeEffect</code> effect using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_completeEffect_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            <strong style="color:red;">import mx.effects.*;

            private function init():void {
                image.setStyle(&quot;completeEffect&quot;, Fade);
            }</strong>

            private function button_click(evt:MouseEvent):void {
                image.load(&quot;assets/Fx.png&quot;);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;mx:Button id=&quot;button&quot;
                label=&quot;Load Image&quot;
                click=&quot;button_click(event);&quot; /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Image id=&quot;image&quot;
            maintainAspectRatio=&quot;true&quot;
            width=&quot;100%&quot;
            height=&quot;100%&quot;
            <strong style="color:red;">initialize=&quot;init();&quot;</strong> /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Image_completeEffect_test/bin/srcview/source/main4.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.controls.Button;
            import mx.controls.Image;
            import mx.effects.*;

            private var button:Button;
            private var image:Image;

            private function init():void {
                button = new Button();
                button.label = "Load Image";
                button.addEventListener(MouseEvent.CLICK, button_click);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(button);
                Application.application.addChildAt(appControlBar, 0);

                image = new Image();
                image.maintainAspectRatio = true;
                image.percentWidth = 100;
                image.percentHeight = 100;
                image.setStyle("completeEffect", Fade);
                addChild(image);
            }

            private function button_click(evt:MouseEvent):void {
                image.load("assets/Fx.png");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a complete effect on an Image control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/29/setting-a-complete-effect-on-an-image-control-in-flex/',contentID: 'post-689',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'completeEffect',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/06/29/setting-a-complete-effect-on-an-image-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sequencing effects in Flex using the mx:Sequence tag (redux)</title>
		<link>http://blog.flexexamples.com/2008/04/23/sequencing-effects-in-flex-using-the-mxsequence-tag-redux/</link>
		<comments>http://blog.flexexamples.com/2008/04/23/sequencing-effects-in-flex-using-the-mxsequence-tag-redux/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 03:41:33 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fade]]></category>
		<category><![CDATA[Pause]]></category>
		<category><![CDATA[Sequence]]></category>
		<category><![CDATA[SetPropertyAction]]></category>
		<category><![CDATA[WipeRight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/23/sequencing-effects-in-flex-using-the-mxsequence-tag-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/09/19/sequencing-effects-in-flex-using-the-mxsequence-tag/">&#8220;Sequencing effects in Flex using the mx:Sequence tag&#8221;</a>, we saw how you could sequence tween effects using the &#60;mx:Sequence /&#62; tag.</p> <p>The following example shows how you can create the same sequenced effects using ActionScript instead of MXML.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Sequence_test_2/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/09/19/sequencing-effects-in-flex-using-the-mxsequence-tag/">&#8220;Sequencing effects in Flex using the mx:Sequence tag&#8221;</a>, we saw how you could sequence tween effects using the &lt;mx:Sequence /&gt; tag.</p>
<p>The following example shows how you can create the same sequenced effects using ActionScript instead of MXML.</p>
<p>Full code after the jump.</p>
<p><span id="more-605"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Sequence_test_2/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/04/23/sequencing-effects-in-flex-using-the-mxsequence-tag-redux/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.effects.Fade;
            import mx.effects.Pause;
            import mx.effects.Sequence;
            import mx.effects.SetPropertyAction;
            import mx.effects.WipeRight;

            private var fader:Sequence;
            private var wiper:Sequence;

            private function fade_click():void {
                var fadeIn:Fade = new Fade();
                fadeIn.alphaFrom = 0.0;
                fadeIn.alphaTo = 1.0;

                var fadeOut:Fade = new Fade();
                fadeOut.alphaFrom = 1.0;
                fadeOut.alphaTo = 0.0;

                var pause:Pause = new Pause();
                pause.duration = slider.value;

                fader = new Sequence();
                fader.addChild(fadeIn);
                fader.addChild(pause);
                fader.addChild(fadeOut);

                fader.stop();
                fader.play([box]);
            }

            private function wipe_click():void {
                var wipeIn:WipeRight = new WipeRight();
                wipeIn.showTarget = true;

                var wipeOut:WipeRight = new WipeRight();
                wipeOut.showTarget = false;

                var pause:Pause = new Pause();
                pause.duration = slider.value;

                var alphaOn:SetPropertyAction = new SetPropertyAction();
                alphaOn.name = "alpha";
                alphaOn.value = 1.0;

                var alphaOff:SetPropertyAction = new SetPropertyAction();
                alphaOff.name = "alpha";
                alphaOff.value = 0.0;

                wiper = new Sequence();
                wiper.addChild(alphaOn);
                wiper.addChild(wipeIn);
                wiper.addChild(pause);
                wiper.addChild(wipeOut);
                wiper.addChild(alphaOff);

                wiper.stop();
                wiper.play([box]);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="fade box"
                click="fade_click();" /&gt;
        &lt;mx:Button label="wipe box"
                click="wipe_click();" /&gt;

        &lt;mx:Spacer width="100%" /&gt;

        &lt;mx:Label text="effect pause ({slider.value} ms):" /&gt;
        &lt;mx:HSlider id="slider"
                minimum="1000"
                maximum="3000"
                value="1500"
                labels="[1000,2000,3000]"
                liveDragging="true"
                showTrackHighlight="true"
                snapInterval="100"
                tickInterval="500"
                dataTipPrecision="0" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Box id="box"
            width="100%"
            height="100%"
            backgroundColor="haloSilver"
            alpha="0.0" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Sequence_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Sequence_test_2/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Sequencing effects in Flex using the mx:Sequence tag (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/23/sequencing-effects-in-flex-using-the-mxsequence-tag-redux/',contentID: 'post-605',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '',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/04/23/sequencing-effects-in-flex-using-the-mxsequence-tag-redux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Setting effects with ActionScript in Flex</title>
		<link>http://blog.flexexamples.com/2008/02/27/setting-effects-with-actionscript-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/02/27/setting-effects-with-actionscript-in-flex/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 03:55:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fade]]></category>
		<category><![CDATA[Rotate]]></category>
		<category><![CDATA[VBox]]></category>
		<category><![CDATA[hideEffect]]></category>
		<category><![CDATA[showEffect]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/27/setting-effects-with-actionscript-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set effects on a Flex Image control using ActionScript by setting the showEffect and hideEffect effects using the setStyle() method.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VBox_showEffect_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/27/setting-effects-with-actionscript-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.effects.easing.*; private function [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set effects on a Flex Image control using ActionScript by setting the <code>showEffect</code> and <code>hideEffect</code> effects using the setStyle() method.</p>
<p>Full code after the jump.</p>
<p><span id="more-532"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VBox_showEffect_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/02/27/setting-effects-with-actionscript-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.effects.easing.*;

            private function init():void {
                img.setStyle("showEffect", rotate);
                img.setStyle("hideEffect", fade);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Fade id="fade" /&gt;
    &lt;mx:Rotate id="rotate"
            angleFrom="-180"
            angleTo="0"
            easingFunction="Elastic.easeInOut"
            duration="2000" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="visible:"&gt;
                &lt;mx:ToggleButtonBar id="toggleButtonBar"
                        itemClick="img.visible = event.item.data;"&gt;
                    &lt;mx:dataProvider&gt;
                        &lt;mx:Array&gt;
                            &lt;mx:Object label="Show" data="true" /&gt;
                            &lt;mx:Object label="Hide" data="false" /&gt;
                        &lt;/mx:Array&gt;
                    &lt;/mx:dataProvider&gt;
                &lt;/mx:ToggleButtonBar&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Image id="img"
            source="@Embed('assets/flashplayer_icon.jpg')"
            width="100"
            height="100" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VBox_showEffect_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/VBox_showEffect_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>Or, you can also create the effect using ActionScript instead of MXML, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VBox_showEffect_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/02/27/setting-effects-with-actionscript-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.effects.easing.*;
            import mx.effects.Fade;
            import mx.effects.Rotate;

            private var fade:Fade;
            private var rotate:Rotate;

            private function init():void {
                // Fade effect
                fade = new Fade();
                // Rotate effect
                rotate = new Rotate();
                rotate.angleFrom = -180;
                rotate.angleTo = 0;
                rotate.easingFunction = Elastic.easeInOut;
                rotate.duration = 2000;

                img.setStyle("showEffect", rotate);
                img.setStyle("hideEffect", fade);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="visible:"&gt;
                &lt;mx:ToggleButtonBar id="toggleButtonBar"
                        itemClick="img.visible = event.item.data;"&gt;
                    &lt;mx:dataProvider&gt;
                        &lt;mx:Array&gt;
                            &lt;mx:Object label="Show" data="true" /&gt;
                            &lt;mx:Object label="Hide" data="false" /&gt;
                        &lt;/mx:Array&gt;
                    &lt;/mx:dataProvider&gt;
                &lt;/mx:ToggleButtonBar&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Image id="img"
            source="@Embed('assets/flashplayer_icon.jpg')"
            width="100"
            height="100" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VBox_showEffect_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/VBox_showEffect_test_2/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting effects with ActionScript in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/27/setting-effects-with-actionscript-in-flex/',contentID: 'post-532',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'hideEffect,showEffect',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/02/27/setting-effects-with-actionscript-in-flex/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

