<?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; RadialGradient</title>
	<atom:link href="http://blog.flexexamples.com/category/radialgradient/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>Setting the focal point on a Rect object in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 07:21:15 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[RadialGradient]]></category>
		<category><![CDATA[Rect]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[focalPointRatio]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can set the focal point on a Flex Gumbo Rect object by setting the focalPointRatio property to a value between -1 and +1.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the focal point on a Flex Gumbo Rect object by setting the <code>focalPointRatio</code> property to a value between -1 and +1.</p>
<p>Full code after the jump.</p>
<p><span id="more-911"></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/Rect_fill_RadialGradient_focalPointRatio_test/bin/srcview/source/main_4390.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/ --&gt;
&lt;Application name="Rect_fill_RadialGradient_focalPointRatio_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="focalPointRatio:"&gt;
                &lt;HSlider id="slider1"
                        minimum="-1.0"
                        maximum="1.0"
                        value="0.0"
                        snapInterval="0.1"
                        tickInterval="0.1"
                        liveDragging="true" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="rotation:"&gt;
                &lt;HSlider id="slider2"
                        minimum="-360"
                        maximum="360"
                        value="0"
                        snapInterval="1"
                        tickInterval="45"
                        liveDragging="true" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;Graphic&gt;
        &lt;Rect id="rect" width="300" height="200"&gt;
            &lt;fill&gt;
                &lt;RadialGradient id="radialGradient"
                        focalPointRatio="{slider1.value}"
                        rotation="{slider2.value}"&gt;
                    &lt;entries&gt;
                        &lt;GradientEntry color="red" /&gt;
                        &lt;GradientEntry color="white" /&gt;
                        &lt;GradientEntry color="blue" /&gt;
                    &lt;/entries&gt;
                &lt;/RadialGradient&gt;
            &lt;/fill&gt;
        &lt;/Rect&gt;
    &lt;/Graphic&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Rect_fill_RadialGradient_focalPointRatio_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Rect_fill_RadialGradient_focalPointRatio_test/bin/main_4390.html" width="100%" height="400"></iframe></p>
<p>You can also set the <code>focalPointRatio</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Rect_fill_RadialGradient_focalPointRatio_test/bin/srcview/source/main2_4390.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/ --&gt;
&lt;Application name="Rect_fill_RadialGradient_focalPointRatio_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.events.SliderEvent;

            private function slider1_change(evt:SliderEvent):void {
                radialGradient.focalPointRatio = evt.value;
            }

            private function slider2_change(evt:SliderEvent):void {
                radialGradient.rotation = evt.value;
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="focalPointRatio:"&gt;
                &lt;HSlider id="slider1"
                        minimum="-1.0"
                        maximum="1.0"
                        value="0.0"
                        snapInterval="0.1"
                        tickInterval="0.1"
                        liveDragging="true"
                        change="slider1_change(event);" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="rotation:"&gt;
                &lt;HSlider id="slider2"
                        minimum="-360"
                        maximum="360"
                        value="0"
                        snapInterval="1"
                        tickInterval="45"
                        liveDragging="true"
                        change="slider2_change(event);" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;Graphic&gt;
        &lt;Rect id="rect" width="300" height="200"&gt;
            &lt;fill&gt;
                &lt;RadialGradient id="radialGradient"&gt;
                    &lt;entries&gt;
                        &lt;GradientEntry color="red" /&gt;
                        &lt;GradientEntry color="white" /&gt;
                        &lt;GradientEntry color="blue" /&gt;
                    &lt;/entries&gt;
                &lt;/RadialGradient&gt;
            &lt;/fill&gt;
        &lt;/Rect&gt;
    &lt;/Graphic&gt;

&lt;/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/Rect_fill_RadialGradient_focalPointRatio_test/bin/srcview/source/main3_4390.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/ --&gt;
&lt;Application name="Rect_fill_RadialGradient_focalPointRatio_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.HSlider;
            import mx.events.SliderEvent;
            import mx.graphics.GradientEntry;
            import mx.graphics.Graphic;
            import mx.graphics.RadialGradient;
            import mx.graphics.Rect;

            private var slider1:HSlider;
            private var slider2:HSlider;
            private var rect:Rect;
            private var radialGradient:RadialGradient;

            private function init():void {
                slider1 = new HSlider();
                slider1.minimum = -1.0;
                slider1.maximum = 1.0;
                slider1.value = 0.0;
                slider1.snapInterval = 0.1;
                slider1.tickInterval = 0.1;
                slider1.liveDragging = true;
                slider1.addEventListener(SliderEvent.CHANGE, slider1_change);

                slider2 = new HSlider();
                slider2.minimum = -360;
                slider2.maximum = 360;
                slider2.value = 0;
                slider2.snapInterval = 1;
                slider2.tickInterval = 45;
                slider2.liveDragging = true;
                slider2.addEventListener(SliderEvent.CHANGE, slider2_change);

                var formItem1:FormItem = new FormItem();
                formItem1.label = "focalPointRatio:";
                formItem1.addChild(slider1);

                var formItem2:FormItem = new FormItem();
                formItem2.label = "rotation:";
                formItem2.addChild(slider2);

                var form:Form = new Form();
                form.styleName = "plain";
                form.addChild(formItem1);
                form.addChild(formItem2);

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

                var entryArr:Array = [];
                entryArr.push(new GradientEntry(0xFF0000)); // red
                entryArr.push(new GradientEntry(0xFFFFFF)); // white
                entryArr.push(new GradientEntry(0x0000FF)); // blue

                radialGradient = new RadialGradient();
                radialGradient.entries = entryArr;

                rect = new Rect();
                rect.fill = radialGradient;
                rect.width = 300;
                rect.height = 200;

                var graphic:Graphic = new Graphic();
                graphic.addElement(rect);
                addChild(graphic);
            }

            private function slider1_change(evt:SliderEvent):void {
                radialGradient.focalPointRatio = evt.value;
            }

            private function slider2_change(evt:SliderEvent):void {
                radialGradient.rotation = evt.value;
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/Application&gt;
</pre>
<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: 'Setting the focal point on a Rect object in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/',contentID: 'post-911',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fill,focalPointRatio,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/12/25/setting-the-focal-point-on-a-rect-object-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the origin X and Y coordinate for a radial gradient fill in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/12/24/setting-the-origin-x-and-y-coordinate-for-a-radial-gradient-fill-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/12/24/setting-the-origin-x-and-y-coordinate-for-a-radial-gradient-fill-in-flex-gumbo/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 04:39:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[GradientEntry]]></category>
		<category><![CDATA[RadialGradient]]></category>
		<category><![CDATA[Rect]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[x]]></category>
		<category><![CDATA[y]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/24/setting-the-origin-x-and-y-coordinate-for-a-radial-gradient-fill-in-flex-gumbo/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/">&#8220;Creating a radial gradient fill on a Rect object in Flex Gumbo&#8221;</a>, we saw how you could create a radial gradient fill on a Flex Gumbo Rect object by setting the fill property to a RadialGradient object.</p> <p>The following example shows how you can set the origin X and Y [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/">&#8220;Creating a radial gradient fill on a Rect object in Flex Gumbo&#8221;</a>, we saw how you could create a radial gradient fill on a Flex Gumbo Rect object by setting the <code>fill</code> property to a RadialGradient object.</p>
<p>The following example shows how you can set the origin X and Y coordinate for a radial gradient fill in Flex Gumbo by setting the <code>x</code> and <code>y</code> properties on the RadialGradient object.</p>
<p>Full code after the jump.</p>
<p><span id="more-910"></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="">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/12/24/setting-the-origin-x-and-y-coordinate-for-a-radial-gradient-fill-in-flex-gumbo/ --&gt;
&lt;Application name=&quot;Rect_fill_RadialGradient_x_test&quot;
        xmlns=&quot;http://ns.adobe.com/mxml/2009&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;Form styleName=&quot;plain&quot;&gt;
            &lt;FormItem label=&quot;x:&quot;&gt;
                &lt;HSlider id=&quot;sliderX&quot;
                        minimum=&quot;-150&quot;
                        maximum=&quot;450&quot;
                        value=&quot;150&quot;
                        snapInterval=&quot;1&quot;
                        tickInterval=&quot;50&quot;
                        liveDragging=&quot;true&quot; /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label=&quot;y:&quot;&gt;
                &lt;HSlider id=&quot;sliderY&quot;
                        minimum=&quot;-100&quot;
                        maximum=&quot;300&quot;
                        value=&quot;100&quot;
                        snapInterval=&quot;1&quot;
                        tickInterval=&quot;50&quot;
                        liveDragging=&quot;true&quot; /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;Graphic&gt;
        &lt;Rect id=&quot;rect&quot; width=&quot;300&quot; height=&quot;200&quot;&gt;
            &lt;fill&gt;
                &lt;RadialGradient x=&quot;{sliderX.value}&quot; y=&quot;{sliderY.value}&quot;&gt;
                    &lt;entries&gt;
                        &lt;GradientEntry color=&quot;red&quot; /&gt;
                        &lt;GradientEntry color=&quot;white&quot; /&gt;
                        &lt;GradientEntry color=&quot;blue&quot; /&gt;
                    &lt;/entries&gt;
                &lt;/RadialGradient&gt;
            &lt;/fill&gt;
        &lt;/Rect&gt;
    &lt;/Graphic&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Rect_fill_RadialGradient_x_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Rect_fill_RadialGradient_x_test/bin/main_4390.html" width="100%" height="350"></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: 'Setting the origin X and Y coordinate for a radial gradient fill in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/24/setting-the-origin-x-and-y-coordinate-for-a-radial-gradient-fill-in-flex-gumbo/',contentID: 'post-910',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fill,Gumbo,x,y',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/12/24/setting-the-origin-x-and-y-coordinate-for-a-radial-gradient-fill-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a radial gradient fill on a Rect object in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 07:56:29 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[RadialGradient]]></category>
		<category><![CDATA[Rect]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/">&#8220;Creating a linear gradient fill on an Ellipse object in Flex Gumbo&#8221;</a>, we saw you could create a linear gradient fill on a Flex Gumbo Ellipse object by setting the fill property to a LinearGradient object.</p> <p>The following example shows how you can create a radial gradient fill on a [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/">&#8220;Creating a linear gradient fill on an Ellipse object in Flex Gumbo&#8221;</a>, we saw you could create a linear gradient fill on a Flex Gumbo Ellipse object by setting the <code>fill</code> property to a LinearGradient object.</p>
<p>The following example shows how you can create a radial gradient fill on a Flex Gumbo Rect object by setting the <code>fill</code> property to a RadialGradient object.</p>
<p>Full code after the jump.</p>
<p><span id="more-909"></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="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/ --&gt;
&lt;Application name="Rect_fill_RadialGradient_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Graphic&gt;
        &lt;Rect id="rect" width="300" height="200"&gt;
            &lt;fill&gt;
                &lt;RadialGradient&gt;
                    &lt;entries&gt;
                        &lt;GradientEntry color="red" /&gt;
                        &lt;GradientEntry color="white" /&gt;
                        &lt;GradientEntry color="blue" /&gt;
                    &lt;/entries&gt;
                &lt;/RadialGradient&gt;
            &lt;/fill&gt;
        &lt;/Rect&gt;
    &lt;/Graphic&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Rect_fill_RadialGradient_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Rect_fill_RadialGradient_test/bin/main_4390.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: 'Creating a radial gradient fill on a Rect object in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/',contentID: 'post-909',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fill,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/12/23/creating-a-radial-gradient-fill-on-a-rect-object-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating a radial gradient fill on a ColumnChart control&#8217;s column series in Flex</title>
		<link>http://blog.flexexamples.com/2007/11/22/creating-a-radial-gradient-fill-on-a-columnchart-controls-column-series-in-flex/</link>
		<comments>http://blog.flexexamples.com/2007/11/22/creating-a-radial-gradient-fill-on-a-columnchart-controls-column-series-in-flex/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 08:43:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[ColumnChart]]></category>
		<category><![CDATA[RadialGradient]]></category>
		<category><![CDATA[columnseries]]></category>
		<category><![CDATA[fill]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/22/creating-a-radial-gradient-fill-on-a-columnchart-controls-column-series-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/11/20/creating-a-linear-gradient-fill-on-a-columnchart-controls-column-series-in-flex/">&#8220;Creating a linear gradient fill on a ColumnChart control&#8217;s column series in Flex&#8221;</a>, we saw how to create a linear gradient fill for a ColumnChart in Flex. In the following example we look at how to create a radial gradient fill.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColumnSeries_fill_RadialGradient_test/main.mxml">View [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/11/20/creating-a-linear-gradient-fill-on-a-columnchart-controls-column-series-in-flex/">&#8220;Creating a linear gradient fill on a ColumnChart control&#8217;s column series in Flex&#8221;</a>, we saw how to create a linear gradient fill for a ColumnChart in Flex. In the following example we look at how to create a radial gradient fill.</p>
<p>Full code after the jump.</p>
<p><span id="more-326"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColumnSeries_fill_RadialGradient_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/11/22/creating-a-radial-gradient-fill-on-a-columnchart-controls-column-series-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[
            import mx.charts.events.ChartItemEvent;
            import mx.charts.chartClasses.IAxis;
            import mx.charts.series.items.ColumnSeriesItem;
            import mx.core.UIComponent;

            private function linearAxis_labelFunc(item:Object, prevValue:Object, axis:IAxis):String {
                return currencyFormatter.format(item);
            }

            private function categoryAxis_labelFunc(item:Object, prevValue:Object, axis:CategoryAxis, categoryItem:Object):String {
                var datNum:Number = Date.parse(item);
                var tempDate:Date = new Date(datNum);
                return dateFormatter.format(tempDate).toUpperCase();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:DateFormatter id="dateFormatter" formatString="DD" /&gt;
    &lt;mx:CurrencyFormatter id="currencyFormatter" precision="2" /&gt;

    &lt;mx:XMLListCollection id="dp"&gt;
        &lt;mx:source&gt;
            &lt;mx:XMLList&gt;
                &lt;quote date="8/1/2007" open="40.29" close="39.58" /&gt;
                &lt;quote date="8/2/2007" open="39.4" close="39.52" /&gt;
                &lt;quote date="8/3/2007" open="39.47" close="38.75" /&gt;
                &lt;quote date="8/6/2007" open="38.71" close="39.38" /&gt;
                &lt;quote date="8/7/2007" open="39.08" close="39.42" /&gt;
                &lt;quote date="8/8/2007" open="39.61" close="40.23" /&gt;
                &lt;quote date="8/9/2007" open="39.9" close="40.75" /&gt;
                &lt;quote date="8/10/2007" open="41.3" close="41.06" /&gt;
                &lt;quote date="8/13/2007" open="41" close="40.83" /&gt;
                &lt;quote date="8/14/2007" open="41.01" close="40.41" /&gt;
                &lt;quote date="8/15/2007" open="40.22" close="40.18" /&gt;
                &lt;quote date="8/16/2007" open="39.83" close="39.96" /&gt;
                &lt;quote date="8/17/2007" open="40.18" close="40.32" /&gt;
                &lt;quote date="8/20/2007" open="40.55" close="40.74" /&gt;
                &lt;quote date="8/21/2007" open="40.41" close="40.13" /&gt;
                &lt;quote date="8/22/2007" open="40.4" close="40.77" /&gt;
                &lt;quote date="8/23/2007" open="40.82" close="40.6" /&gt;
                &lt;quote date="8/24/2007" open="40.5" close="40.41" /&gt;
                &lt;quote date="8/27/2007" open="40.38" close="40.81" /&gt;
            &lt;/mx:XMLList&gt;
        &lt;/mx:source&gt;
    &lt;/mx:XMLListCollection&gt;

    &lt;mx:ColumnChart id="columnChart"
            showDataTips="true"
            dataProvider="{dp}"
            width="100%"
            height="100%"&gt;

        &lt;mx:backgroundElements&gt;
            &lt;mx:GridLines&gt;
                &lt;mx:horizontalStroke&gt;
                    &lt;mx:Stroke color="haloSilver" weight="0" /&gt;
                &lt;/mx:horizontalStroke&gt;
            &lt;/mx:GridLines&gt;
        &lt;/mx:backgroundElements&gt;

        &lt;!-- vertical axis --&gt;
        &lt;mx:verticalAxis&gt;
            &lt;mx:LinearAxis baseAtZero="false"
                    labelFunction="linearAxis_labelFunc" /&gt;
        &lt;/mx:verticalAxis&gt;

        &lt;!-- horizontal axis --&gt;
        &lt;mx:horizontalAxis&gt;
            &lt;mx:CategoryAxis id="ca"
                    categoryField="@date"
                    title="August 2007"
                    labelFunction="categoryAxis_labelFunc" /&gt;
        &lt;/mx:horizontalAxis&gt;

        &lt;!-- horizontal axis renderer --&gt;
        &lt;mx:horizontalAxisRenderers&gt;
            &lt;mx:AxisRenderer axis="{ca}"
                    canDropLabels="true" /&gt;
        &lt;/mx:horizontalAxisRenderers&gt;

        &lt;!-- series --&gt;
        &lt;mx:series&gt;
            &lt;mx:ColumnSeries displayName="Open"
                    xField="@date"
                    yField="@open"&gt;
                &lt;mx:fill&gt;
                    &lt;mx:RadialGradient&gt;
                        &lt;mx:entries&gt;
                            &lt;mx:Array&gt;
                                &lt;mx:GradientEntry color="white"
                                        ratio="0.0"
                                        alpha="1.0" /&gt;
                                &lt;mx:GradientEntry color="haloBlue"
                                        ratio="1.0"
                                        alpha="1.0" /&gt;
                            &lt;/mx:Array&gt;
                        &lt;/mx:entries&gt;
                    &lt;/mx:RadialGradient&gt;
                &lt;/mx:fill&gt;
            &lt;/mx:ColumnSeries&gt;
        &lt;/mx:series&gt;

        &lt;!-- series filters --&gt;
        &lt;mx:seriesFilters&gt;
            &lt;mx:Array /&gt;
        &lt;/mx:seriesFilters&gt;
    &lt;/mx:ColumnChart&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColumnSeries_fill_RadialGradient_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/ColumnSeries_fill_RadialGradient_test/bin/main.html" width="100%" height="500"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a radial gradient fill on a ColumnChart control\&#039;s column series in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/22/creating-a-radial-gradient-fill-on-a-columnchart-controls-column-series-in-flex/',contentID: 'post-326',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'columnseries,fill',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/2007/11/22/creating-a-radial-gradient-fill-on-a-columnchart-controls-column-series-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

