<?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; scaleMode</title>
	<atom:link href="http://blog.flexexamples.com/tag/scalemode/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 a Spark Image control in Flex Hero</title>
		<link>http://blog.flexexamples.com/2010/09/04/setting-the-scale-mode-on-a-spark-image-control-in-flex-hero/</link>
		<comments>http://blog.flexexamples.com/2010/09/04/setting-the-scale-mode-on-a-spark-image-control-in-flex-hero/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 21:35:06 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Image (Spark)]]></category>
		<category><![CDATA[BitmapScaleMode]]></category>
		<category><![CDATA[fillMode]]></category>
		<category><![CDATA[Hero]]></category>
		<category><![CDATA[scaleMode]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3345</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/09/04/setting-the-fill-mode-on-a-spark-image-control-in-flex-hero/">&#8220;Setting the fill mode on a Spark Image control in Flex Hero&#8221;</a>, we saw how you could set the fill mode on a Spark Image control in Flex Hero by setting the fillMode property to one of the static constants in the mx.graphics.BitmapFillMode class.</p> <p>The following example shows how you [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/09/04/setting-the-fill-mode-on-a-spark-image-control-in-flex-hero/">&#8220;Setting the fill mode on a Spark Image control in Flex Hero&#8221;</a>, we saw how you could set the fill mode on a Spark Image control in Flex Hero by setting the <code>fillMode</code> property to one of the static constants in the mx.graphics.BitmapFillMode class.</p>
<p>The following example shows how you can set the scale mode on a Spark Image control in Flex Hero by setting the <code>fillMode</code> property to &#8220;scale&#8221; and setting the <code>scaleMode</code> property to one of the static constants in the mx.graphics.BitmapScaleMode class.</p>
<p><span id="more-3345"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the beta Adobe Flex Hero 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 Hero SDK, see <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/09/04/setting-the-scale-mode-on-a-spark-image-control-in-flex-hero/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_Image_scaleMode_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> label=<span style="color: #ff0000;">&quot;scaleMode:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropDownList</span> id=<span style="color: #ff0000;">&quot;ddl&quot;</span> selectedItem=<span style="color: #ff0000;">&quot;letterbox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[letterbox,scale]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:DropDownList</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s: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:Image</span> id=<span style="color: #ff0000;">&quot;img&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;assets/pattern_149.gif&quot;</span></span>
<span style="color: #000000;">            fillMode=<span style="color: #ff0000;">&quot;scale&quot;</span></span>
<span style="color: #000000;">            scaleMode=<span style="color: #ff0000;">&quot;{ddl.selectedItem}&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;black&quot;</span></span>
<span style="color: #000000;">            backgroundAlpha=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;20&quot;</span> right=<span style="color: #ff0000;">&quot;20&quot;</span> top=<span style="color: #ff0000;">&quot;20&quot;</span> bottom=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex Hero 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 Hero SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the scale mode on a Spark Image control in Flex Hero on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/09/04/setting-the-scale-mode-on-a-spark-image-control-in-flex-hero/',contentID: 'post-3345',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'BitmapScaleMode,fillMode,Hero,scaleMode',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/09/04/setting-the-scale-mode-on-a-spark-image-control-in-flex-hero/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>
	</channel>
</rss>

