<?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; paddingLeft</title>
	<atom:link href="http://blog.flexexamples.com/category/paddingleft/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>Changing the padding on a Button control in Flex</title>
		<link>http://blog.flexexamples.com/2008/01/02/changing-the-padding-on-a-button-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/01/02/changing-the-padding-on-a-button-control-in-flex/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 05:26:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Button]]></category>
		<category><![CDATA[paddingLeft]]></category>
		<category><![CDATA[paddingRight]]></category>
		<category><![CDATA[horizontalGap]]></category>
		<category><![CDATA[paddingBottom]]></category>
		<category><![CDATA[paddingTop]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/02/changing-the-padding-on-a-button-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can modify the padding between the Button control&#8217;s label and icon and the button&#8217;s edges by setting the paddingLeft, paddingRight, paddingTop, paddingBottom, and horizontalGap styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Button_padding_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/02/changing-the-padding-on-a-button-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Style&#62; HSlider [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can modify the padding between the Button control&#8217;s label and icon and the button&#8217;s edges by setting the <code>paddingLeft</code>, <code>paddingRight</code>, <code>paddingTop</code>, <code>paddingBottom</code>, and <code>horizontalGap</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-416"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Button_padding_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/02/changing-the-padding-on-a-button-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Style&gt;
        HSlider {
            labelOffset: 0;
            dataTipPlacement: right;
        }

        .iconButton {
            icon: Embed("bullet_picture.png");
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                leftSlider.value = button.getStyle("paddingLeft");
                rightSlider.value = button.getStyle("paddingRight");
                topSlider.value = button.getStyle("paddingTop");
                bottomSlider.value = button.getStyle("paddingBottom");
                horizontalGapSlider.value = button.getStyle("horizontalGap");
            }

            private function updatePadding():void {
                button.setStyle("paddingLeft", leftSlider.value);
                button.setStyle("paddingRight", rightSlider.value);
                button.setStyle("paddingTop", topSlider.value);
                button.setStyle("paddingBottom", bottomSlider.value);
                button.setStyle("horizontalGap", horizontalGapSlider.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="labelArr"&gt;
        &lt;mx:Number&gt;0&lt;/mx:Number&gt;
        &lt;mx:Number&gt;4&lt;/mx:Number&gt;
        &lt;mx:Number&gt;8&lt;/mx:Number&gt;
        &lt;mx:Number&gt;12&lt;/mx:Number&gt;
        &lt;mx:Number&gt;16&lt;/mx:Number&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="paddingLeft:"&gt;
                &lt;mx:HSlider id="leftSlider"
                        minimum="0"
                        maximum="16"
                        snapInterval="1"
                        labels="{labelArr}"
                        liveDragging="true"
                        showTrackHighlight="true"
                        change="updatePadding();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="paddingRight:"&gt;
                &lt;mx:HSlider id="rightSlider"
                        minimum="0"
                        maximum="16"
                        labels="{labelArr}"
                        snapInterval="1"
                        liveDragging="true"
                        showTrackHighlight="true"
                        change="updatePadding();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="paddingTop:"&gt;
                &lt;mx:HSlider id="topSlider"
                        minimum="0"
                        maximum="16"
                        labels="{labelArr}"
                        snapInterval="1"
                        liveDragging="true"
                        showTrackHighlight="true"
                        change="updatePadding();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="paddingBottom:"&gt;
                &lt;mx:HSlider id="bottomSlider"
                        minimum="0"
                        maximum="16"
                        labels="{labelArr}"
                        snapInterval="1"
                        liveDragging="true"
                        showTrackHighlight="true"
                        change="updatePadding();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="horizontalGap:"&gt;
                &lt;mx:HSlider id="horizontalGapSlider"
                        minimum="0"
                        maximum="16"
                        labels="{labelArr}"
                        snapInterval="1"
                        liveDragging="true"
                        showTrackHighlight="true"
                        change="updatePadding();" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Button id="button" label="label" styleName="iconButton" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Button_padding_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/Button_padding_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the padding on a Button control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/02/changing-the-padding-on-a-button-control-in-flex/',contentID: 'post-416',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'horizontalGap,paddingBottom,paddingTop',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/01/02/changing-the-padding-on-a-button-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indenting Flex Accordion header labels</title>
		<link>http://blog.flexexamples.com/2007/10/29/indenting-flex-accordion-header-labels/</link>
		<comments>http://blog.flexexamples.com/2007/10/29/indenting-flex-accordion-header-labels/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 15:10:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Accordion]]></category>
		<category><![CDATA[AccordionHeader]]></category>
		<category><![CDATA[paddingLeft]]></category>
		<category><![CDATA[headerStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/29/indenting-flex-accordion-header-labels/</guid>
		<description><![CDATA[<p>A recent comment asked how you can indent the Accordion header text as setting the paddingLeft style wasn&#8217;t working as expected for them. Well, as it turns out, you need to set the paddingLeft style directly on the AccordionHeader style (Flex 2 and 3) or create a new style with paddingLeft style specified and use [...]]]></description>
			<content:encoded><![CDATA[<p>A recent comment asked how you can indent the Accordion header text as setting the <code>paddingLeft</code> style wasn&#8217;t working as expected for them. Well, as it turns out, you need to set the <code>paddingLeft</code> style directly on the AccordionHeader style (Flex 2 and 3) or create a new style with <code>paddingLeft</code> style specified and use the <code>headerStyleName</code> style (Flex 3 only).</p>
<p>Full code after the jump.</p>
<p><span id="more-256"></span></p>
<p>The following example works in Flex 2 and Flex 3:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/AccordionHeader_paddingLeft_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/29/indenting-flex-accordion-header-labels/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        AccordionHeader {
            paddingLeft: 130; /* pixels */
        }
    &lt;/mx:Style&gt;

    &lt;mx:Accordion id="accordion"
            width="100%"
            height="100%"&gt;
        &lt;mx:VBox label="One" /&gt;
        &lt;mx:VBox label="Two" /&gt;
        &lt;mx:VBox label="Three" /&gt;
        &lt;mx:VBox label="Four" /&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/AccordionHeader_paddingLeft_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/AccordionHeader_paddingLeft_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>The following example works in Flex 3:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerStyleName_paddingLeft_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/29/indenting-flex-accordion-header-labels/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"&gt;

    &lt;mx:Style&gt;
        .accHeader {
            paddingLeft: 130; /* pixels */
        }
    &lt;/mx:Style&gt;

    &lt;mx:Accordion headerStyleName="accHeader"
            width="100%"
            height="100%"&gt;
        &lt;mx:VBox label="One" /&gt;
        &lt;mx:VBox label="Two" /&gt;
        &lt;mx:VBox label="Three" /&gt;
        &lt;mx:VBox label="Four" /&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_headerStyleName_paddingLeft_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/Accordion_headerStyleName_paddingLeft_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Indenting Flex Accordion header labels on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/10/29/indenting-flex-accordion-header-labels/',contentID: 'post-256',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'headerStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/10/29/indenting-flex-accordion-header-labels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

