<?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; Ellipse</title>
	<atom:link href="http://blog.flexexamples.com/category/ellipse/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 scale mode on an Ellipse object stroke in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2009/01/10/setting-the-scale-mode-on-an-ellipse-object-stroke-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/01/10/setting-the-scale-mode-on-an-ellipse-object-stroke-in-flex-gumbo/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 16:47:03 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[LineScaleMode]]></category>
		<category><![CDATA[SolidColorStroke]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[scaleMode]]></category>
		<category><![CDATA[scaleX]]></category>
		<category><![CDATA[scaleY]]></category>
		<category><![CDATA[stroke]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/10/setting-the-scale-mode-on-an-ellipse-object-stroke-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can set the scale mode on an Ellipse object&#8217;s stroke object by setting the scaleMode property to one of the static constants in the LineScaleMode 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 [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the scale mode on an Ellipse object&#8217;s stroke object by setting the <code>scaleMode</code> property to one of the static constants in the LineScaleMode class.</p>
<p>Full code after the jump.</p>
<p><span id="more-932"></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/2009/01/10/setting-the-scale-mode-on-an-ellipse-object-stroke-in-flex-gumbo/ --&gt;
&lt;Application name="Ellipse_stroke_scaleMode_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="scaleMode:"&gt;
                &lt;ComboBox id="comboBox" selectedIndex="1"&gt;
                    &lt;dataProvider&gt;
                        &lt;Array&gt;
                            &lt;String&gt;{LineScaleMode.NONE}&lt;/String&gt;
                            &lt;String&gt;{LineScaleMode.NORMAL}&lt;/String&gt;
                            &lt;String&gt;{LineScaleMode.HORIZONTAL}&lt;/String&gt;
                            &lt;String&gt;{LineScaleMode.VERTICAL}&lt;/String&gt;
                        &lt;/Array&gt;
                    &lt;/dataProvider&gt;
                &lt;/ComboBox&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="scaleX:"&gt;
                &lt;HSlider id="xSlider"
                        minimum="1"
                        maximum="5"
                        value="1"
                        tickInterval="1"
                        liveDragging="true" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="scaleY:"&gt;
                &lt;HSlider id="ySlider"
                        minimum="1"
                        maximum="5"
                        value="1"
                        tickInterval="1"
                        liveDragging="true" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;Graphic&gt;
        &lt;Ellipse id="ellipse"
                width="80"
                height="60"
                scaleX="{xSlider.value}"
                scaleY="{ySlider.value}"&gt;
            &lt;stroke&gt;
                &lt;SolidColorStroke id="lineStroke"
                        scaleMode="{comboBox.selectedItem}"
                        weight="10" /&gt;
            &lt;/stroke&gt;
        &lt;/Ellipse&gt;
    &lt;/Graphic&gt;

&lt;/Application&gt;
</pre>
<p>You can also set the <code>scaleMode</code> property using ActionScript, as seen in the following example:</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/2009/01/10/setting-the-scale-mode-on-an-ellipse-object-stroke-in-flex-gumbo/ --&gt;
&lt;Application name="Ellipse_stroke_scaleMode_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

            private function comboBox_change(evt:ListEvent):void {
                lineStroke.scaleMode = comboBox.selectedItem.toString();
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="scaleMode:"&gt;
                &lt;ComboBox id="comboBox"
                        selectedIndex="1"
                        change="comboBox_change(event);"&gt;
                    &lt;dataProvider&gt;
                        &lt;Array&gt;
                            &lt;String&gt;{LineScaleMode.NONE}&lt;/String&gt;
                            &lt;String&gt;{LineScaleMode.NORMAL}&lt;/String&gt;
                            &lt;String&gt;{LineScaleMode.HORIZONTAL}&lt;/String&gt;
                            &lt;String&gt;{LineScaleMode.VERTICAL}&lt;/String&gt;
                        &lt;/Array&gt;
                    &lt;/dataProvider&gt;
                &lt;/ComboBox&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="scaleX:"&gt;
                &lt;HSlider id="xSlider"
                        minimum="1"
                        maximum="5"
                        value="1"
                        tickInterval="1"
                        liveDragging="true" /&gt;
            &lt;/FormItem&gt;
            &lt;FormItem label="scaleY:"&gt;
                &lt;HSlider id="ySlider"
                        minimum="1"
                        maximum="5"
                        value="1"
                        tickInterval="1"
                        liveDragging="true" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;Graphic&gt;
        &lt;Ellipse id="ellipse"
                width="80"
                height="60"
                scaleX="{xSlider.value}"
                scaleY="{ySlider.value}"&gt;
            &lt;stroke&gt;
                &lt;SolidColorStroke id="lineStroke"
                        weight="10" /&gt;
            &lt;/stroke&gt;
        &lt;/Ellipse&gt;
    &lt;/Graphic&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 scale mode on an Ellipse object stroke in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/10/setting-the-scale-mode-on-an-ellipse-object-stroke-in-flex-gumbo/',contentID: 'post-932',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,scaleMode,scaleX,scaleY,stroke',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/01/10/setting-the-scale-mode-on-an-ellipse-object-stroke-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting the thickness of a stroke on an Ellipse in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/11/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 14:34:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[SolidColorStroke]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[stroke]]></category>
		<category><![CDATA[weight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can set an Ellipse object&#8217;s stroke weight by setting the weight property on the SolidColorStroke object.</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 [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set an Ellipse object&#8217;s stroke weight by setting the <code>weight</code> property on the SolidColorStroke object.</p>
<p>Full code after the jump.</p>
<p><span id="more-881"></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/SolidColorStroke_weight_test/bin/srcview/source/main_4171.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/ --&gt;
&lt;FxApplication name="SolidColorStroke_weight_test"
        xmlns="http://ns.adobe.com/mxml/2009"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;Form&gt;
        &lt;FormItem label="weight:"&gt;
            &lt;HSlider id="slider"
                    minimum="0"
                    maximum="20"
                    value="0"
                    snapInterval="1"
                    tickInterval="1"
                    liveDragging="true" /&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id="ellipse"
            width="300"
            height="200"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;stroke&gt;
            &lt;SolidColorStroke id="stroke"
                    weight="{slider.value}" /&gt;
        &lt;/stroke&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/SolidColorStroke_weight_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/SolidColorStroke_weight_test/bin/main_4171.html" width="100%" height="350"></iframe></p>
<p>You can also set the <code>weight</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/SolidColorStroke_weight_test/bin/srcview/source/main2_4171.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/ --&gt;
&lt;FxApplication name="SolidColorStroke_weight_test"
        xmlns="http://ns.adobe.com/mxml/2009"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

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

            private function slider_change(evt:SliderEvent):void {
                stroke.weight = evt.value;
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;Form&gt;
        &lt;FormItem label="weight:"&gt;
            &lt;HSlider id="slider"
                    minimum="0"
                    maximum="20"
                    value="0"
                    snapInterval="1"
                    tickInterval="1"
                    liveDragging="true"
                    change="slider_change(event);" /&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id="ellipse"
            width="300"
            height="200"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;stroke&gt;
            &lt;SolidColorStroke id="stroke" /&gt;
        &lt;/stroke&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&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/SolidColorStroke_weight_test/bin/srcview/source/main3_4171.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/ --&gt;
&lt;FxApplication name="SolidColorStroke_weight_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        initialize="init();"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.HSlider;
            import mx.events.SliderEvent;
            import mx.graphics.Ellipse;
            import mx.graphics.SolidColorStroke;

            private var slider:HSlider;
            private var ellipse:Ellipse;

            private function init():void {
                slider = new HSlider();
                slider.minimum = 0;
                slider.maximum = 20;
                slider.value = 0;
                slider.snapInterval = 1;
                slider.tickInterval = 1;
                slider.liveDragging = true;
                slider.addEventListener(SliderEvent.CHANGE, slider_change);

                var formItem:FormItem = new FormItem();
                formItem.label = "weight:";
                formItem.addChild(slider);

                var form:Form = new Form();
                form.addChild(formItem);
                addItem(form);

                ellipse = new Ellipse();
                ellipse.stroke = new SolidColorStroke();
                ellipse.width = 300;
                ellipse.height = 200;
                ellipse.horizontalCenter = 0;
                ellipse.verticalCenter = 0;
                addItem(ellipse);
            }

            private function slider_change(evt:SliderEvent):void {
                ellipse.stroke.weight = evt.value;
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/FxApplication&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 thickness of a stroke on an Ellipse in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/',contentID: 'post-881',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,stroke,weight',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/28/setting-the-thickness-of-a-stroke-on-an-ellipse-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a linear gradient fill on an Ellipse object in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 15:27:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[GradientEntry]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/">&#8220;Creating a solid color fill on an Ellipse object in Flex Gumbo&#8221;</a>, we saw how you could create a solid color fill on an Ellipse object by setting the fill property to a SolidColor object.</p> <p>The following example shows how you can create a linear gradient fill on a Flex [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/">&#8220;Creating a solid color fill on an Ellipse object in Flex Gumbo&#8221;</a>, we saw how you could create a solid color fill on an Ellipse object by setting the <code>fill</code> property to a SolidColor object.</p>
<p>The following example shows how you can create a linear gradient fill on a Flex Gumbo Ellipse object by setting the <code>fill</code> property to a LinearGradient object.</p>
<p>Full code after the jump.</p>
<p><span id="more-880"></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/Ellipse_fill_LinearGradient_test/bin/srcview/source/main_4171.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/ --&gt;
&lt;FxApplication name="Ellipse_fill_LinearGradient_test"
        xmlns="http://ns.adobe.com/mxml/2009"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;Form&gt;
        &lt;FormItem label="color 1:"&gt;
            &lt;ColorPicker id="colorPicker1"
                    selectedColor="red" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="alpha 1:"&gt;
            &lt;HSlider id="slider1"
                    minimum="0.0"
                    maximum="1.0"
                    value="1.0"
                    snapInterval="0.1"
                    tickInterval="0.1"
                    liveDragging="true" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="color 2:"&gt;
            &lt;ColorPicker id="colorPicker2"
                    selectedColor="green" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="alpha 2:"&gt;
            &lt;HSlider id="slider2"
                    minimum="0.0"
                    maximum="1.0"
                    value="1.0"
                    snapInterval="0.1"
                    tickInterval="0.1"
                    liveDragging="true" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="color 3:"&gt;
            &lt;ColorPicker id="colorPicker3"
                    selectedColor="blue" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="alpha 3:"&gt;
            &lt;HSlider id="slider3"
                    minimum="0.0"
                    maximum="1.0"
                    value="1.0"
                    snapInterval="0.1"
                    tickInterval="0.1"
                    liveDragging="true" /&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id="ellipse"
            width="200"
            height="300"
            horizontalCenter="100"
            verticalCenter="0"&gt;
        &lt;fill&gt;
            &lt;LinearGradient&gt;
                &lt;GradientEntry id="gradientEntry1"
                        color="{colorPicker1.selectedColor}"
                        alpha="{slider1.value}" /&gt;
                &lt;GradientEntry id="gradientEntry2"
                        color="{colorPicker2.selectedColor}"
                        alpha="{slider2.value}" /&gt;
                &lt;GradientEntry id="gradientEntry3"
                        color="{colorPicker3.selectedColor}"
                        alpha="{slider3.value}" /&gt;
            &lt;/LinearGradient&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Ellipse_fill_LinearGradient_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/Ellipse_fill_LinearGradient_test/bin/main_4171.html" width="100%" height="450"></iframe></p>
<p>You could also set the GradientEntry object&#8217;s <code>color</code> and <code>alpha</code> properties using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Ellipse_fill_LinearGradient_test/bin/srcview/source/main2_4171.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/ --&gt;
&lt;FxApplication name="Ellipse_fill_LinearGradient_test"
        xmlns="http://ns.adobe.com/mxml/2009"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

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

            private function colorPicker1_change(evt:ColorPickerEvent):void {
                gradientEntry1.color = evt.color;
            }

            private function slider1_change(evt:SliderEvent):void {
                gradientEntry1.alpha = evt.value;
            }

            private function colorPicker2_change(evt:ColorPickerEvent):void {
                gradientEntry2.color = evt.color;
            }

            private function slider2_change(evt:SliderEvent):void {
                gradientEntry2.alpha = evt.value;
            }

            private function colorPicker3_change(evt:ColorPickerEvent):void {
                gradientEntry3.color = evt.color;
            }

            private function slider3_change(evt:SliderEvent):void {
                gradientEntry3.alpha = evt.value;
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;Form&gt;
        &lt;FormItem label="color 1:"&gt;
            &lt;ColorPicker id="colorPicker1"
                    selectedColor="red"
                    change="colorPicker1_change(event);" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="alpha 1:"&gt;
            &lt;HSlider id="slider1"
                    minimum="0.0"
                    maximum="1.0"
                    value="1.0"
                    snapInterval="0.1"
                    tickInterval="0.1"
                    liveDragging="true"
                    change="slider1_change(event);" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="color 2:"&gt;
            &lt;ColorPicker id="colorPicker2"
                    selectedColor="green"
                    change="colorPicker2_change(event);" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="alpha 2:"&gt;
            &lt;HSlider id="slider2"
                    minimum="0.0"
                    maximum="1.0"
                    value="1.0"
                    snapInterval="0.1"
                    tickInterval="0.1"
                    liveDragging="true"
                    change="slider2_change(event);" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="color 3:"&gt;
            &lt;ColorPicker id="colorPicker3"
                    selectedColor="blue"
                    change="colorPicker3_change(event);" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="alpha 3:"&gt;
            &lt;HSlider id="slider3"
                    minimum="0.0"
                    maximum="1.0"
                    value="1.0"
                    snapInterval="0.1"
                    tickInterval="0.1"
                    liveDragging="true"
                    change="slider3_change(event);" /&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id="ellipse"
            width="200"
            height="300"
            horizontalCenter="100"
            verticalCenter="0"&gt;
        &lt;fill&gt;
            &lt;LinearGradient&gt;
                &lt;GradientEntry id="gradientEntry1" color="red" /&gt;
                &lt;GradientEntry id="gradientEntry2" color="green" /&gt;
                &lt;GradientEntry id="gradientEntry3" color="blue" /&gt;
            &lt;/LinearGradient&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&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/Ellipse_fill_LinearGradient_test/bin/srcview/source/main3_4171.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/ --&gt;
&lt;FxApplication name="Ellipse_fill_LinearGradient_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        initialize="init();"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.ColorPicker;
            import mx.controls.HSlider;
            import mx.events.ColorPickerEvent;
            import mx.events.SliderEvent;
            import mx.graphics.Ellipse;
            import mx.graphics.GradientEntry;
            import mx.graphics.LinearGradient;

            private var colorPicker1:ColorPicker;
            private var colorPicker2:ColorPicker;
            private var colorPicker3:ColorPicker;
            private var slider1:HSlider;
            private var slider2:HSlider;
            private var slider3:HSlider;

            private var ellipse:Ellipse;
            private var gradientEntry1:GradientEntry;
            private var gradientEntry2:GradientEntry;
            private var gradientEntry3:GradientEntry;

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

                colorPicker2 = new ColorPicker();
                colorPicker2.selectedColor = 0x00FF00; // green
                colorPicker2.addEventListener(ColorPickerEvent.CHANGE, colorPicker2_change);

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

                slider1 = new HSlider();
                slider1.minimum = 0.0;
                slider1.maximum = 1.0;
                slider1.value = 1.0;
                slider1.snapInterval = 0.1;
                slider1.tickInterval = 0.1;
                slider1.liveDragging = true;
                slider1.addEventListener(SliderEvent.CHANGE, slider1_change);

                slider2 = new HSlider();
                slider2.minimum = 0.0;
                slider2.maximum = 1.0;
                slider2.value = 1.0;
                slider2.snapInterval = 0.1;
                slider2.tickInterval = 0.1;
                slider2.liveDragging = true;
                slider2.addEventListener(SliderEvent.CHANGE, slider2_change);

                slider3 = new HSlider();
                slider3.minimum = 0.0;
                slider3.maximum = 1.0;
                slider3.value = 1.0;
                slider3.snapInterval = 0.1;
                slider3.tickInterval = 0.1;
                slider3.liveDragging = true;
                slider3.addEventListener(SliderEvent.CHANGE, slider3_change);

                var formItem1a:FormItem = new FormItem();
                formItem1a.label = "color 1:";
                formItem1a.addChild(colorPicker1);

                var formItem1b:FormItem = new FormItem();
                formItem1b.label = "alpha 1:";
                formItem1b.addChild(slider1);

                var formItem2a:FormItem = new FormItem();
                formItem2a.label = "color 2:";
                formItem2a.addChild(colorPicker2);

                var formItem2b:FormItem = new FormItem();
                formItem2b.label = "alpha 2:";
                formItem2b.addChild(slider2);

                var formItem3a:FormItem = new FormItem();
                formItem3a.label = "color 3:";
                formItem3a.addChild(colorPicker3);

                var formItem3b:FormItem = new FormItem();
                formItem3b.label = "alpha 3:";
                formItem3b.addChild(slider3);

                var form:Form = new Form();
                form.addChild(formItem1a); // colorPicker1
                form.addChild(formItem1b); // slider1
                form.addChild(formItem2a); // colorPicker2
                form.addChild(formItem2b); // slider2
                form.addChild(formItem3a); // colorPicker3
                form.addChild(formItem3b); // slider3
                addItem(form);

                gradientEntry1 = new GradientEntry(0xFF0000); // red
                gradientEntry2 = new GradientEntry(0x00FF00); // green
                gradientEntry3 = new GradientEntry(0x0000FF); // blue

                var gradientArr:Array = [];
                gradientArr.push(gradientEntry1);
                gradientArr.push(gradientEntry2);
                gradientArr.push(gradientEntry3);

                var linearGradient:LinearGradient = new LinearGradient();
                linearGradient.entries = gradientArr;

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

            private function colorPicker1_change(evt:ColorPickerEvent):void {
                gradientEntry1.color = evt.color;
            }

            private function slider1_change(evt:SliderEvent):void {
                gradientEntry1.alpha = evt.value;
            }

            private function colorPicker2_change(evt:ColorPickerEvent):void {
                gradientEntry2.color = evt.color;
            }

            private function slider2_change(evt:SliderEvent):void {
                gradientEntry2.alpha = evt.value;
            }

            private function colorPicker3_change(evt:ColorPickerEvent):void {
                gradientEntry3.color = evt.color;
            }

            private function slider3_change(evt:SliderEvent):void {
                gradientEntry3.alpha = evt.value;
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/FxApplication&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: 'Creating a linear gradient fill on an Ellipse object in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/',contentID: 'post-880',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/11/27/creating-a-linear-gradient-fill-on-an-ellipse-object-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a solid color fill on a Spark Ellipse object in Flex 4</title>
		<link>http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 14:47:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[SolidColor]]></category>
		<category><![CDATA[fill]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can create a solid color fill on a Spark Ellipse object in Flex 4 by setting the fill property to a SolidColor object.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/ --&#62; &#60;s:Application name=&#34;Spark_Ellipse_fill_solidColor_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;mx:Form&#62; &#60;mx:FormItem label=&#34;color:&#34;&#62; &#60;mx:ColorPicker id=&#34;colorPicker&#34; /&#62; &#60;/mx:FormItem&#62; &#60;mx:FormItem label=&#34;alpha:&#34;&#62; &#60;s:HSlider id=&#34;slider&#34; minimum=&#34;0.0&#34; maximum=&#34;1.0&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a solid color fill on a Spark Ellipse object in Flex 4 by setting the <code>fill</code> property to a SolidColor object.</p>
<p><span id="more-878"></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/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Ellipse_fill_solidColor_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;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;color:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;alpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;s:Ellipse</span> id=<span style="color: #ff0000;">&quot;ellipse&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;200&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;{colorPicker.selectedColor}&quot;</span></span>
<span style="color: #000000;">                    alpha=<span style="color: #ff0000;">&quot;{slider.value}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Ellipse</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/Ellipse_fill_solidColor_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/Ellipse_fill_solidColor_test/bin/main_4178.html" width="100%" height="300"></iframe></p>
<p>You can also set the SolidColor object&#8217;s <code>color</code> and <code>alpha</code> properties using ActionScript, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Ellipse_fill_solidColor_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>
&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.ColorPickerEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function colorPicker_changeHandler<span style="color: #66cc66;">&#40;</span>evt:ColorPickerEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                solidColor.color = evt.color;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function slider_changeHandler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                solidColor.alpha = evt.currentTarget.value;</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:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;color:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;colorPicker_changeHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;alpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;slider_changeHandler(event);&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;s:Ellipse</span> id=<span style="color: #ff0000;">&quot;ellipse&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;200&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> id=<span style="color: #ff0000;">&quot;solidColor&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Ellipse</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>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/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Ellipse_fill_solidColor_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>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.containers.Form;</span>
<span style="color: #000000;">            import mx.containers.FormItem;</span>
<span style="color: #000000;">            import mx.controls.ColorPicker;</span>
<span style="color: #000000;">            import mx.events.ColorPickerEvent;</span>
<span style="color: #000000;">            import mx.graphics.SolidColor;</span>
<span style="color: #000000;">            import spark.components.HSlider;</span>
<span style="color: #000000;">            import spark.primitives.Ellipse;</span>
&nbsp;
<span style="color: #000000;">            protected var colorPicker:ColorPicker;</span>
<span style="color: #000000;">            protected var slider:HSlider;</span>
<span style="color: #000000;">            protected var ellipse:Ellipse;</span>
<span style="color: #000000;">            protected var solidColor:SolidColor;</span>
&nbsp;
<span style="color: #000000;">            protected 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;">                colorPicker = new ColorPicker<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                colorPicker.addEventListener<span style="color: #66cc66;">&#40;</span>ColorPickerEvent.CHANGE, colorPicker_changeHandler<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                slider = new HSlider<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                slider.minimum = <span style="color: #cc66cc;">0.0</span>;</span>
<span style="color: #000000;">                slider.maximum = <span style="color: #cc66cc;">1.0</span>;</span>
<span style="color: #000000;">                slider.value = <span style="color: #cc66cc;">1.0</span>;</span>
<span style="color: #000000;">                slider.snapInterval = <span style="color: #cc66cc;">0.1</span>;</span>
<span style="color: #000000;">                slider.stepSize = <span style="color: #cc66cc;">0.1</span>;</span>
<span style="color: #000000;">                slider.addEventListener<span style="color: #66cc66;">&#40;</span>Event.CHANGE, slider_changeHandler<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var formItem1:FormItem = new FormItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                formItem1.label = <span style="color: #ff0000;">&quot;color:&quot;</span>;</span>
<span style="color: #000000;">                formItem1.addElement<span style="color: #66cc66;">&#40;</span>colorPicker<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var formItem2:FormItem = new FormItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                formItem2.label = <span style="color: #ff0000;">&quot;alpha:&quot;</span>;</span>
<span style="color: #000000;">                formItem2.addElement<span style="color: #66cc66;">&#40;</span>slider<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var form:Form = new Form<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                form.addElement<span style="color: #66cc66;">&#40;</span>formItem1<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                form.addElement<span style="color: #66cc66;">&#40;</span>formItem2<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                this.controlBarContent = <span style="color: #66cc66;">&#91;</span>form<span style="color: #66cc66;">&#93;</span>;</span>
&nbsp;
<span style="color: #000000;">                solidColor = new SolidColor<span style="color: #66cc66;">&#40;</span>colorPicker.selectedColor, slider.value<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                ellipse = new Ellipse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                ellipse.fill = solidColor;</span>
<span style="color: #000000;">                ellipse.width = <span style="color: #cc66cc;">300</span>;</span>
<span style="color: #000000;">                ellipse.height = <span style="color: #cc66cc;">200</span>;</span>
<span style="color: #000000;">                ellipse.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                ellipse.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>ellipse<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function colorPicker_changeHandler<span style="color: #66cc66;">&#40;</span>evt:ColorPickerEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                solidColor.color = evt.color;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function slider_changeHandler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                solidColor.alpha = evt.currentTarget.value;</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: 'Creating a solid color fill on a Spark Ellipse object in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/',contentID: 'post-878',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/11/26/creating-a-solid-color-fill-on-an-ellipse-object-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Setting a blend mode on an Ellipse in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/11/25/setting-a-blend-mode-on-an-ellipse-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/25/setting-a-blend-mode-on-an-ellipse-in-flex-gumbo/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 07:20:03 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[blendMode]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/25/setting-a-blend-mode-on-an-ellipse-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can set the blend mode of an Ellipse object by setting the blendMode property.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the blend mode of an Ellipse object by setting the <code>blendMode</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-872"></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/11/25/setting-a-blend-mode-on-an-ellipse-in-flex-gumbo/ --&gt;
&lt;FxApplication name="Ellipse_blendMode_test"
        xmlns="http://ns.adobe.com/mxml/2009"&gt;

    &lt;Form&gt;
        &lt;FormItem label="blendMode:"&gt;
            &lt;ComboBox id="comboBox"&gt;
                &lt;dataProvider&gt;
                    &lt;String&gt;{BlendMode.ADD}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.ALPHA}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.DARKEN}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.DIFFERENCE}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.ERASE}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.HARDLIGHT}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.INVERT}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.LAYER}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.LIGHTEN}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.MULTIPLY}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.NORMAL}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.OVERLAY}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.SCREEN}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.SHADER}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.SUBTRACT}&lt;/String&gt;
                &lt;/dataProvider&gt;
            &lt;/ComboBox&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id="ellipse1"
            width="100"
            height="100"
            horizontalCenter="-25"
            verticalCenter="-25"&gt;
        &lt;fill&gt;
            &lt;SolidColor color="red" /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

    &lt;Ellipse id="ellipse2"
            width="100"
            height="100"
            horizontalCenter="25"
            verticalCenter="-25"&gt;
        &lt;fill&gt;
            &lt;SolidColor color="blue" /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

    &lt;Ellipse id="ellipse3"
            blendMode="{comboBox.selectedItem}"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="25"&gt;
        &lt;fill&gt;
            &lt;SolidColor color="green" /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&gt;
</pre>
<p>You can also set the <code>blendMode</code> property using ActionScript, as seen in the following example:</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/11/25/setting-a-blend-mode-on-an-ellipse-in-flex-gumbo/ --&gt;
&lt;FxApplication name="Ellipse_blendMode_test"
        xmlns="http://ns.adobe.com/mxml/2009"&gt;

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

            private function comboBox_change(evt:ListEvent):void {
                ellipse3.blendMode = comboBox.selectedItem.toString();
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;Form&gt;
        &lt;FormItem label="blendMode:"&gt;
            &lt;ComboBox id="comboBox"
                    change="comboBox_change(event);"&gt;
                &lt;dataProvider&gt;
                    &lt;String&gt;{BlendMode.ADD}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.ALPHA}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.DARKEN}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.DIFFERENCE}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.ERASE}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.HARDLIGHT}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.INVERT}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.LAYER}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.LIGHTEN}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.MULTIPLY}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.NORMAL}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.OVERLAY}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.SCREEN}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.SHADER}&lt;/String&gt;
                    &lt;String&gt;{BlendMode.SUBTRACT}&lt;/String&gt;
                &lt;/dataProvider&gt;
            &lt;/ComboBox&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;Ellipse id="ellipse1"
            width="100"
            height="100"
            horizontalCenter="-25"
            verticalCenter="-25"&gt;
        &lt;fill&gt;
            &lt;SolidColor color="red" /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

    &lt;Ellipse id="ellipse2"
            width="100"
            height="100"
            horizontalCenter="25"
            verticalCenter="-25"&gt;
        &lt;fill&gt;
            &lt;SolidColor color="blue" /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

    &lt;Ellipse id="ellipse3"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="25"&gt;
        &lt;fill&gt;
            &lt;SolidColor color="green" /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&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 a blend mode on an Ellipse in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/25/setting-a-blend-mode-on-an-ellipse-in-flex-gumbo/',contentID: 'post-872',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'blendMode,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/25/setting-a-blend-mode-on-an-ellipse-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting a mask type on an Ellipse in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/11/11/setting-a-mask-type-on-an-ellipse-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/11/setting-a-mask-type-on-an-ellipse-in-flex-gumbo/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 03:51:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[mask]]></category>
		<category><![CDATA[maskType]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/11/setting-a-mask-type-on-an-ellipse-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can set an Ellipse object&#8217;s mask type as a clip mask or alpha mask by setting the maskType property.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set an Ellipse object&#8217;s mask type as a clip mask or alpha mask by setting the <code>maskType</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-859"></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/Ellipse_maskType_test/bin/srcview/source/main_4423.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/11/setting-a-mask-type-on-an-ellipse-in-flex-gumbo/ --&gt;
&lt;FxApplication xmlns="http://ns.adobe.com/mxml/2009"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;Form&gt;
        &lt;FormItem label="maskType:"&gt;
            &lt;ComboBox id="comboBox"
                    dataProvider="[clip,alpha]" /&gt;
        &lt;/FormItem&gt;
        &lt;FormItem label="mask alpha:"
                direction="horizontal"&gt;
            &lt;HSlider id="slider"
                    minimum="0.0"
                    maximum="1.0"
                    value="1.0"
                    liveDragging="true" /&gt;
            &lt;Label text="{slider.value.toFixed(1)}" /&gt;
        &lt;/FormItem&gt;
    &lt;/Form&gt;

    &lt;VGroup horizontalCenter="0" bottom="10"&gt;
        &lt;Ellipse id="ellipse"
                maskType="{comboBox.selectedItem}"
                width="400"
                height="200"&gt;
            &lt;mask&gt;
                &lt;Group&gt;
                    &lt;Rect width="100" height="100"&gt;
                        &lt;fill&gt;
                            &lt;SolidColor alpha="{slider.value}" /&gt;
                        &lt;/fill&gt;
                    &lt;/Rect&gt;
                &lt;/Group&gt;
            &lt;/mask&gt;
            &lt;fill&gt;
                &lt;SolidColor color="#FF00FF" /&gt;
            &lt;/fill&gt;
        &lt;/Ellipse&gt;
    &lt;/VGroup&gt;

&lt;/FxApplication&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Ellipse_maskType_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Ellipse_maskType_test/bin/main_4423.html" width="100%" height="400"></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 a mask type on an Ellipse in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/11/setting-a-mask-type-on-an-ellipse-in-flex-gumbo/',contentID: 'post-859',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,mask,maskType',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/11/setting-a-mask-type-on-an-ellipse-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using graphical and text primitives in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/10/30/using-graphical-and-text-primitives-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/10/30/using-graphical-and-text-primitives-in-flex-gumbo/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 08:03:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Ellipse]]></category>
		<category><![CDATA[FXG]]></category>
		<category><![CDATA[SolidColor]]></category>
		<category><![CDATA[group]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/30/using-graphical-and-text-primitives-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows you how to draw an ellipse in a Flex Gumbo application using the new Ellipse graphic primitive in FXG.</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 [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how to draw an ellipse in a Flex Gumbo application using the new Ellipse graphic primitive in FXG.</p>
<p>Full code after the jump.</p>
<p><span id="more-850"></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/FXG_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/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;FxApplication name="FXG_test"
        xmlns="http://ns.adobe.com/mxml/2009"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;Ellipse id="ellipse"
            width="100"
            height="100"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;fill&gt;
            &lt;SolidColor color="red" /&gt;
        &lt;/fill&gt;
    &lt;/Ellipse&gt;

&lt;/FxApplication&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FXG_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/FXG_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>You could also create a custom component from the Ellipse with the FXG namespace, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FXG_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/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;FxApplication name="FXG_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:comps="comps.*"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;comps:RedEllipse id="ellipse"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/FxApplication&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FXG_test/bin/srcview/source/comps/RedEllipse.fxg">comps/RedEllipse.fxg</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;Ellipse xmlns="http://ns.adobe.com/fxg/2008"
        width="100"
        height="100"&gt;
    &lt;fill&gt;
        &lt;SolidColor color="red" /&gt;
    &lt;/fill&gt;
&lt;/Ellipse&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/FXG_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/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;FxApplication name="FXG_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        initialize="init();"&gt;
    &lt;layout&gt;
        &lt;BasicLayout /&gt;
    &lt;/layout&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.graphics.Ellipse;
            import mx.graphics.SolidColor;

            private var ellipse:Ellipse;

            private function init():void {
                ellipse = new Ellipse();
                ellipse.fill = new SolidColor(0xFF0000);
                ellipse.width = 100;
                ellipse.height = 100;
                ellipse.horizontalCenter = 0;
                ellipse.verticalCenter = 0;
                addItem(ellipse);
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/FxApplication&gt;
</pre>
<p>However, if you were using the &lt;Application /&gt; tag instead of the &lt;FxApplication /&gt; tag, the syntax is slightly different.<br />
First, if you tried to use an Ellipse graphic primitive as a direct child of a Halo container (Application, Panel, Canvas, etc.), you would currently get a compiler error saying the following:</p>
<blockquote><p>
&#8216;Ellipse&#8217; declaration must be contained within the &lt;Declarations&gt; tag since it does not implement mx.core.IUIComponent.
</p></blockquote>
<p>To get around this you need to wrap the Ellipse (or other graphic primitives such as BitmapGraphic, Path, Rect, TextGraphic, TextBox, etc) in within a Group class instance (or one of its subclasses such as HGroup, VGroup, Graphic, MXMLComponent, or Skin).</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FXG_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/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;Application name="FXG_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="absolute"
        backgroundColor="white"&gt;

    &lt;Group id="group"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;Ellipse id="ellipse"
                width="100"
                height="100"&gt;
            &lt;fill&gt;
                &lt;SolidColor color="red" /&gt;
            &lt;/fill&gt;
        &lt;/Ellipse&gt;
    &lt;/Group&gt;

&lt;/Application&gt;
</pre>
<p>You could also create a custom component from the Ellipse with the FXG namespace, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FXG_test/bin/srcview/source/main5.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/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;Application name="FXG_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        xmlns:comps="comps.*"
        layout="absolute"
        backgroundColor="white"&gt;

    &lt;Group id="group"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;comps:RedEllipse id="ellipse" /&gt;
    &lt;/Group&gt;

&lt;/Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FXG_test/bin/srcview/source/comps/RedEllipse.fxg">comps/RedEllipse.fxg</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;Ellipse xmlns="http://ns.adobe.com/fxg/2008"
        width="100"
        height="100"&gt;
    &lt;fill&gt;
        &lt;SolidColor color="red" /&gt;
    &lt;/fill&gt;
&lt;/Ellipse&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/FXG_test/bin/srcview/source/main6.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/30/using-graphical-and-text-primitives-in-flex-gumbo/ --&gt;
&lt;Application name="FXG_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="absolute"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.components.Group;
            import mx.graphics.Ellipse;
            import mx.graphics.SolidColor;

            private var group:Group;
            private var ellipse:Ellipse;

            private function init():void {
                ellipse = new Ellipse();
                ellipse.fill = new SolidColor(0xFF0000);
                ellipse.width = 100;
                ellipse.height = 100;

                group = new Group();
                group.setStyle("horizontalCenter", 0);
                group.setStyle("verticalCenter", 0);
                group.addItem(ellipse);
                addChild(group);
            }
        ]]&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>
<p>For more information see the <a href="http://opensource.adobe.com/wiki/display/flexsdk/FXG+1.0+Specification">FXG 1.0 Specification</a> page at opensource.adobe.com.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using graphical and text primitives in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/30/using-graphical-and-text-primitives-in-flex-gumbo/',contentID: 'post-850',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'group',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/30/using-graphical-and-text-primitives-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

