<?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; Label</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/label/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>Using a CFF embedded font with an MX Label control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 02:42:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[Label]]></category>
		<category><![CDATA[Label (Spark)]]></category>
		<category><![CDATA[UIFTETextField]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[textFieldClass]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/</guid>
		<description><![CDATA[<p>The following example shows how you can use a CFF embedded font with a Halo Label control and Spark Label control by setting the textFieldClass style on the MX Label control to the mx.core.UIFTETextField class.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;MX_Label_textFieldClass_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; &#160; &#60;fx:Style&#62; @namespace mx &#34;library://ns.adobe.com/flex/mx&#34;; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use a CFF embedded font with a Halo Label control and Spark Label control by setting the <code>textFieldClass</code> style on the MX Label control to the mx.core.UIFTETextField class.</p>
<p><span id="more-1110"></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/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_Label_textFieldClass_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:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        @font-face {
            src: url(&quot;fonts/base02.ttf&quot;);
            fontFamily: Base02Embedded;
            embedAsCFF: true;
        }
&nbsp;
        mx|Label,
        s|Label {
            fontFamily: Base02Embedded;
            fontSize: 16;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> 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;mx:Label</span> id=<span style="color: #ff0000;">&quot;hLbl&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog. [mx|Label]&quot;</span></span>
<span style="color: #000000;">                textFieldClass=<span style="color: #ff0000;">&quot;mx.core.UIFTETextField&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;sLbl&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog. [s|Label]&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_Label_textFieldClass_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_Label_textFieldClass_test/main.html" width="100%" height="150"></iframe></p>
<p>You can also set the <code>textFieldClass</code> style using an external .CSS file or &lt;Style/&gt; block, 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/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_Label_textFieldClass_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:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        @font-face {
            src: url(&quot;fonts/base02.ttf&quot;);
            fontFamily: Base02Embedded;
            embedAsCFF: true;
        }
&nbsp;
        mx|Label {
            fontFamily: Base02Embedded;
            fontSize: 16;
            textFieldClass: ClassReference(&quot;mx.core.UIFTETextField&quot;);
        }
&nbsp;
        s|Label {
            fontFamily: Base02Embedded;
            fontSize: 16;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> 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;mx:Label</span> id=<span style="color: #ff0000;">&quot;hLbl&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog. [mx|Label]&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;sLbl&quot;</span></span>
<span style="color: #000000;">                text=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog. [s|Label]&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using a CFF embedded font with an MX Label control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/',contentID: 'post-1110',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,textFieldClass',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/06/14/using-a-cff-embedded-font-with-a-halo-label-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Setting the font sharpness for a Label control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 06:05:01 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Label]]></category>
		<category><![CDATA[fontAntiAliasType]]></category>
		<category><![CDATA[fontSharpness]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the font sharpness on a Flex Label control by setting the fontSharpness and fontAntiAliasType styles.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&#62; &#60;mx:Application name="Label_fontSharpness_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: local("Arial"); fontFamily: ArialEmbedded; } @font-face { src: local("Base 02"); fontFamily: Base02Embedded; } &#60;/mx:Style&#62; &#60;mx:ApplicationControlBar dock="true"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the font sharpness on a Flex Label control by setting the <code>fontSharpness</code> and <code>fontAntiAliasType</code> styles.</p>
<p><span id="more-756"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application name="Label_fontSharpness_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="fontFamily:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="[ArialEmbedded,Base02Embedded]" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontSharpness:" direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="-400"
                        maximum="400"
                        value="0"
                        snapInterval="10"
                        tickInterval="50"
                        liveDragging="true" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog."
            fontFamily="{comboBox.selectedItem}"
            fontSize="16"
            fontAntiAliasType="advanced"
            fontSharpness="{slider.value}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontSharpness_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/Label_fontSharpness_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>You can also set the <code>fontSharpness</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontSharpness_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/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application name="Label_fontSharpness_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }

        Label {
            fontAntiAliasType: advanced;
            fontFamily: Base02Embedded;
            fontSize: 16;
            fontSharpness: 400;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog." /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>fontSharpness</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontSharpness_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/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application name="Label_fontSharpness_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }

        .myLabel {
            fontAntiAliasType: advanced;
            fontFamily: ArialEmbedded;
            fontSize: 16;
        }
    &lt;/mx:Style&gt;

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

            private function comboBox_change(evt:ListEvent):void {
                lbl.setStyle("fontFamily", comboBox.selectedItem);
            }

            private function slider_change(evt:SliderEvent):void {
                lbl.setStyle("fontSharpness", evt.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="fontFamily:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="[ArialEmbedded,Base02Embedded]"
                        change="comboBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="fontSharpness:" direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="-400"
                        maximum="400"
                        value="0"
                        snapInterval="10"
                        tickInterval="50"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog."
            styleName="myLabel" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the font sharpness for a Label control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/',contentID: 'post-756',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontAntiAliasType,fontSharpness',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/08/21/setting-the-font-sharpness-for-a-label-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting the font thickness for a Label control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/21/setting-the-font-thickness-for-a-label-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/21/setting-the-font-thickness-for-a-label-control-in-flex/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 05:18:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Label]]></category>
		<category><![CDATA[fontAntiAliasType]]></category>
		<category><![CDATA[fontThickness]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/21/setting-the-font-thickness-for-a-label-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the font thickness on a Flex Label control by setting the fontThickness and fontAntiAliasType styles.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontThickness_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/21/setting-the-font-thickness-for-a-label-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; @font-face { src: local("Base 02"); fontFamily: Base02Embedded; } &#60;/mx:Style&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="fontThickness:" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the font thickness on a Flex Label control by setting the <code>fontThickness</code> and <code>fontAntiAliasType</code> styles.</p>
<p><span id="more-755"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontThickness_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/08/21/setting-the-font-thickness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="fontThickness:" direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="-200"
                        maximum="200"
                        value="0"
                        snapInterval="10"
                        tickInterval="20"
                        liveDragging="true" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog."
            fontFamily="Base02Embedded"
            fontSize="16"
            fontAntiAliasType="advanced"
            fontThickness="{slider.value}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontThickness_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/Label_fontThickness_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>You can also set the <code>fontThickness</code> style using an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontThickness_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/08/21/setting-the-font-thickness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }

        Label {
            fontAntiAliasType: advanced;
            fontFamily: Base02Embedded;
            fontSize: 16;
            fontThickness: -200;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog." /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>fontThickness</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_fontThickness_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/08/21/setting-the-font-thickness-for-a-label-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }
    &lt;/mx:Style&gt;

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

            private function slider_change(evt:SliderEvent):void {
                lbl.setStyle("fontThickness", evt.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="fontThickness:" direction="horizontal"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="-200"
                        maximum="200"
                        value="0"
                        snapInterval="10"
                        tickInterval="20"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
                &lt;mx:Label text="{slider.value}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Label id="lbl"
            text="The quick brown fox jumped over the lazy dog."
            fontFamily="Base02Embedded"
            fontSize="16"
            fontAntiAliasType="advanced" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the font thickness for a Label control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/21/setting-the-font-thickness-for-a-label-control-in-flex/',contentID: 'post-755',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fontAntiAliasType,fontThickness',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/08/21/setting-the-font-thickness-for-a-label-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting when the label changes on a Button control in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/25/detecting-when-the-label-changes-on-a-button-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/25/detecting-when-the-label-changes-on-a-button-control-in-flex/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 06:39:58 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Button]]></category>
		<category><![CDATA[Label]]></category>
		<category><![CDATA[labelChanged]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/25/detecting-when-the-label-changes-on-a-button-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can detect when a Flex Button control&#8217;s label changes using the labelChanged event.</p> <p>Full code after the jump.</p> <p></p> <p class="construction">The labelChanged event isn&#8217;t publicly documented and it isn&#8217;t likely that you&#8217;ll ever need to use it directly. Also note that the Button class has a private Boolean labelChanged [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can detect when a Flex Button control&#8217;s label changes using the <code>labelChanged</code> event.</p>
<p>Full code after the jump.</p>
<p><span id="more-684"></span></p>
<p class="construction">The <code>labelChanged</code> event isn&#8217;t publicly documented and it isn&#8217;t likely that you&#8217;ll ever need to use it directly. Also note that the Button class has a private Boolean <code>labelChanged</code> property, so you need to create the <code>labelChanged</code> event handler in ActionScript instead of MXML.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Button_labelChanged_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/06/25/detecting-when-the-label-changes-on-a-button-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

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

            private function init():void {
                button.addEventListener("labelChanged", button_labelChanged);
            }

            private function button_labelChanged(evt:Event):void {
                Alert.show(evt.toString());
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="One" click="button.label = 'One';" /&gt;
        &lt;mx:Button label="Two" click="button.label = 'Two';" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

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

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Button_labelChanged_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_labelChanged_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Button_labelChanged_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/06/25/detecting-when-the-label-changes-on-a-button-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

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

            private var button:Button;

            private function init():void {
                var btnOne:Button = new Button();
                btnOne.label = "One";
                btnOne.addEventListener(MouseEvent.CLICK, setBtnLabel);

                var btnTwo:Button = new Button();
                btnTwo.label = "Two";
                btnTwo.addEventListener(MouseEvent.CLICK, setBtnLabel);

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

                button = new Button();
                button.label = "Button";
                button.addEventListener("labelChanged", button_labelChanged);
                addChild(button);
            }

            private function setBtnLabel(evt:MouseEvent):void {
                button.label = Button(evt.currentTarget).label;
            }

            private function button_labelChanged(evt:Event):void {
                Alert.show(evt.toString());
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Detecting when the label changes on a Button control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/25/detecting-when-the-label-changes-on-a-button-control-in-flex/',contentID: 'post-684',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'labelChanged',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/06/25/detecting-when-the-label-changes-on-a-button-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing a FormItem container&#8217;s label in Flex 3</title>
		<link>http://blog.flexexamples.com/2008/03/21/customizing-a-formitem-containers-label-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2008/03/21/customizing-a-formitem-containers-label-in-flex-3/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 14:36:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[FormItem]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Label]]></category>
		<category><![CDATA[itemLabel]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/21/customizing-a-formitem-containers-label-in-flex-3/</guid>
		<description><![CDATA[<p>The following example shows how you can access the Label subcomponent in a Flex FormItem container and do fancy stuff like have form labels with hyperlinks or selectable text by using the itemLabel property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FormItem_itemLabel_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/03/21/customizing-a-formitem-containers-label-in-flex-3/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can access the Label subcomponent in a Flex FormItem container and do fancy stuff like have form labels with hyperlinks or selectable text by using the <code>itemLabel</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-569"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FormItem_itemLabel_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/03/21/customizing-a-formitem-containers-label-in-flex-3/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.FlexEvent;
            import mx.controls.Label;
            import mx.controls.Alert;
            import mx.containers.FormItem;

            private function init2(evt:FlexEvent):void {
                var lbl:Label = FormItem(evt.currentTarget).itemLabel as Label;
                lbl.selectable = true;
            }

            private function init3(evt:FlexEvent):void {
                var lbl:Label = FormItem(evt.currentTarget).itemLabel as Label;
                lbl.htmlText = txt;
                lbl.selectable = true;
                lbl.addEventListener(TextEvent.LINK, label_link);
            }

            private function label_link(evt:TextEvent):void {
                Alert.show("You clicked a link. Have some cake.");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:String id="txt"&gt;
        &lt;![CDATA[&lt;a href="event:att"&gt;&lt;u&gt;Hyperlink&lt;/u&gt;&lt;/a&gt; label]]&gt;
    &lt;/mx:String&gt;

    &lt;mx:Form maxWidth="500"&gt;
        &lt;mx:FormItem id="formItem1"
                label="Default label"&gt;
            &lt;mx:Label id="label1"
                    text="The quick brown fox jumped over the..." /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem id="formItem2"
                label="Selectable label"
                creationComplete="init2(event);"&gt;
            &lt;mx:Label id="label2"
                    text="The quick brown fox jumped over the..." /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem id="formItem3"
                label="Hyperlink label"
                creationComplete="init3(event);"&gt;
            &lt;mx:Label id="label3"
                    text="The quick brown fox jumped over the..." /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FormItem_itemLabel_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/FormItem_itemLabel_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Customizing a FormItem container\&#039;s label in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/03/21/customizing-a-formitem-containers-label-in-flex-3/',contentID: 'post-569',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'itemLabel',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/03/21/customizing-a-formitem-containers-label-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Displaying tool tips in a Flex DataGrid control&#8217;s header</title>
		<link>http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/</link>
		<comments>http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 06:13:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[DataGridColumn]]></category>
		<category><![CDATA[Label]]></category>
		<category><![CDATA[headerRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/</guid>
		<description><![CDATA[<p>The following example shows you how you can truncate a DataGrid column&#8217;s text and display a tool tip by setting a custom header renderer.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_headerRenderer_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:XML id="xmlDP"&#62; &#60;nodes&#62; &#60;node col1="One.1" col2="One.2" /&#62; &#60;node col1="Two.1" col2="Two.2" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can truncate a DataGrid column&#8217;s text and display a tool tip by setting a custom header renderer.</p>
<p>Full code after the jump.</p>
<p><span id="more-511"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_headerRenderer_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XML id="xmlDP"&gt;
        &lt;nodes&gt;
            &lt;node col1="One.1" col2="One.2" /&gt;
            &lt;node col1="Two.1" col2="Two.2" /&gt;
            &lt;node col1="Three.1" col2="Three.2" /&gt;
            &lt;node col1="Four.1" col2="Four.2" /&gt;
            &lt;node col1="Five.1" col2="Five.2" /&gt;
            &lt;node col1="Six.1" col2="Six.2" /&gt;
            &lt;node col1="Seven.1" col2="Seven.2" /&gt;
            &lt;node col1="Eight.1" col2="Eight.2" /&gt;
            &lt;node col1="Nine.1" col2="Nine.2" /&gt;
        &lt;/nodes&gt;
    &lt;/mx:XML&gt;

    &lt;mx:DataGrid id="dataGrid"
            dataProvider="{xmlDP.node}"
            width="300"
            height="200"&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField="@col1"
                    headerText="The quick brown fox jumped over the lazy dog"
                    headerRenderer="mx.controls.Label" /&gt;
            &lt;mx:DataGridColumn dataField="@col2"
                    headerText="Lorem ipsum dolor sit amet, consectetuer adipiscing elit"
                    headerRenderer="mx.controls.Label" /&gt;
        &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_headerRenderer_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/DataGrid_headerRenderer_test/bin/main.html" width="100%" height="300"></iframe></p>
<p class="new">Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.controls.DataGrid;
            import mx.controls.Label;

            private var xmlDP:XML = &lt;nodes&gt;
                        &lt;node col1="One.1" col2="One.2" /&gt;
                        &lt;node col1="Two.1" col2="Two.2" /&gt;
                        &lt;node col1="Three.1" col2="Three.2" /&gt;
                        &lt;node col1="Four.1" col2="Four.2" /&gt;
                        &lt;node col1="Five.1" col2="Five.2" /&gt;
                        &lt;node col1="Six.1" col2="Six.2" /&gt;
                        &lt;node col1="Seven.1" col2="Seven.2" /&gt;
                        &lt;node col1="Eight.1" col2="Eight.2" /&gt;
                        &lt;node col1="Nine.1" col2="Nine.2" /&gt;
                    &lt;/nodes&gt;;

            private var dataGrid:DataGrid;
            private var dataGridCol1:DataGridColumn;
            private var dataGridCol2:DataGridColumn;

            private function init():void {
                dataGridCol1 = new DataGridColumn();
                dataGridCol1.dataField = "@col1";
                dataGridCol1.headerText = "The quick brown fox jumped over the lazy dog";
                dataGridCol1.headerRenderer = new ClassFactory(Label);

                dataGridCol2 = new DataGridColumn();
                dataGridCol2.dataField = "@col2";
                dataGridCol2.headerText = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit";
                dataGridCol2.headerRenderer = new ClassFactory(Label);

                dataGrid = new DataGrid();
                dataGrid.dataProvider = xmlDP.node;
                dataGrid.columns = [dataGridCol1, dataGridCol2];
                dataGrid.width = 300;
                dataGrid.height = 200;
                addChild(dataGrid);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying tool tips in a Flex DataGrid control\&#039;s header on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/',contentID: 'post-511',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'headerRenderer',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/02/08/displaying-tool-tips-in-a-flex-datagrid-controls-header/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Truncating the label on a Flex CheckBox control</title>
		<link>http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/</link>
		<comments>http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 03:07:00 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Label]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/</guid>
		<description><![CDATA[<p>The following example shows how you can truncate the label on a CheckBox control in Flex by setting the width property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_width_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:String id="str"&#62;The quick brown fox jumped over the lazy dog.&#60;/mx:String&#62; &#60;mx:Form&#62; &#60;mx:FormItem label="default:"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can truncate the label on a CheckBox control in Flex by setting the <code>width</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-488"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_width_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:String id="str"&gt;The quick brown fox jumped over the lazy dog.&lt;/mx:String&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="default:"&gt;
            &lt;mx:CheckBox id="checkBox1"
                    label="{str}" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="width = 200:"&gt;
            &lt;mx:CheckBox id="checkBox2"
                    label="{str}"
                    width="200" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/CheckBox_width_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/CheckBox_width_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Truncating the label on a Flex CheckBox control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/',contentID: 'post-488',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'width',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/02/06/truncating-the-label-on-a-flex-checkbox-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying a Label control&#8217;s text as a password</title>
		<link>http://blog.flexexamples.com/2008/01/27/displaying-a-label-controls-text-as-a-password/</link>
		<comments>http://blog.flexexamples.com/2008/01/27/displaying-a-label-controls-text-as-a-password/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 17:09:39 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Label]]></category>
		<category><![CDATA[displayAsPassword]]></category>
		<category><![CDATA[textField]]></category>
		<category><![CDATA[truncateToFit]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/27/displaying-a-label-controls-text-as-a-password/</guid>
		<description><![CDATA[<p>The following example shows you how you create a custom Label control in Flex that masks its text as a password by setting the Label control&#8217;s nested protected UITextField control&#8217;s displayAsPassword property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_textField_displayAsPassword_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/27/displaying-a-label-controls-text-as-a-password/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:HBox&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you create a custom Label control in Flex that masks its text as a password by setting the Label control&#8217;s nested protected UITextField control&#8217;s <code>displayAsPassword</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-485"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_textField_displayAsPassword_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/27/displaying-a-label-controls-text-as-a-password/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:local="*"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:HBox&gt;
        &lt;mx:Label text="Password:" /&gt;
        &lt;local:MyLabel id="lbl"
                text="The quick brown fox jumped over the lazy dog."
                truncateToFit="true"
                width="100"
                creationComplete="lbl.tf.displayAsPassword = true;" /&gt;
    &lt;/mx:HBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_textField_displayAsPassword_test/MyLabel.mxml">View MyLabel.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/27/displaying-a-label-controls-text-as-a-password/ --&gt;
&lt;mx:Label xmlns:mx="http://www.adobe.com/2006/mxml"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.IUITextField;

            public function get tf():IUITextField {
                return textField;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Label&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_textField_displayAsPassword_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/Label_textField_displayAsPassword_test/bin/main.html" width="100%" height="100"></iframe></p>
<p>As you can see, the Label control&#8217;s text is masked, but rolling over the label displays the masked text, because the <code>truncateToFit</code> property is set to <code>true</code>.</p>
<p class="note">Note that the truncated Label text does not display the traditional ellipsis (&#8220;&#8230;&#8221;) indicating that the text has been truncated. That is because the ellipsis is also displayed as password text (masked as &#8220;*&#8221;).</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a Label control\&#039;s text as a password on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/27/displaying-a-label-controls-text-as-a-password/',contentID: 'post-485',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'displayAsPassword,textField,truncateToFit',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/27/displaying-a-label-controls-text-as-a-password/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Truncating text in the Flex Label control using the truncateToFit property</title>
		<link>http://blog.flexexamples.com/2008/01/26/truncating-text-in-the-flex-label-control-using-the-truncatetofit-property/</link>
		<comments>http://blog.flexexamples.com/2008/01/26/truncating-text-in-the-flex-label-control-using-the-truncatetofit-property/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 22:09:55 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Label]]></category>
		<category><![CDATA[truncateToFit]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/26/truncating-text-in-the-flex-label-control-using-the-truncatetofit-property/</guid>
		<description><![CDATA[<p>The following example shows how you can use the truncateToFit property in the Label control in Flex to truncate strings if they exceed a specified width. The label control will terminate the string with &#8220;&#8230;&#8221; and allow you to roll over the text and read the entire (non-truncated) text in a tool tip, as seen [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the truncateToFit property in the Label control in Flex to truncate strings if they exceed a specified width. The label control will terminate the string with &#8220;&#8230;&#8221; and allow you to roll over the text and read the entire (non-truncated) text in a tool tip, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Label text=&quot;The quick brown fox jumped over the lazy dog.&quot;
        <strong style="color:red;">truncateToFit=&quot;true&quot;</strong>
        maxWidth=&quot;200&quot; /&gt;
</pre>
<p>Full code after the jump.</p>
<p><span id="more-483"></span></p>
<p>The following example displays three Label controls:<br />
The first Label control (&#8220;default&#8221;), simply sets the text property and allows the Label control to size itself to match the length of the text.<br />
The second Label control (&#8220;truncateToFit = false&#8221;) sets the <code>truncateToFit</code> property to <code>false</code> and sets the <code>maxWidth</code> property to 200 pixels. Because the specified text will not fit within the 200 pixel control, the extra text is not displayed and is cropped off. You can see a portion of a last character in the Label control and rolling over the text will not display a tool tip.<br />
The third Label control (&#8220;truncateToFit = true&#8221;) sets the <code>truncateToFit</code> property to <code>true</code> and sets the <code>maxWidth</code> property to 200 pixels. Because the specified text will not fit within the 200 pixel control, the extra text is not displayed, but the text displays &#8220;&#8230;&#8221; at the end of the control. No partial characters are displayed and rolling over the text displays a tool tip showing the entire contents of the text string.</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/01/26/truncating-text-in-the-flex-label-control-using-the-truncatetofit-property/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Label_truncateToFit_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;str&quot;</span><span style="color: #7400FF;">&gt;</span></span>The quick brown fox jumped over the lazy dog.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:String</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <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;default:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;{str}&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;truncateToFit = false:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> truncateToFit=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">                    text=<span style="color: #ff0000;">&quot;{str}&quot;</span></span>
<span style="color: #000000;">                    maxWidth=<span style="color: #ff0000;">&quot;200&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;truncateToFit = true:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> truncateToFit=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                    text=<span style="color: #ff0000;">&quot;{str}&quot;</span></span>
<span style="color: #000000;">                    maxWidth=<span style="color: #ff0000;">&quot;200&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>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_truncateToFit_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/Label_truncateToFit_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Truncating text in the Flex Label control using the truncateToFit property on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/26/truncating-text-in-the-flex-label-control-using-the-truncatetofit-property/',contentID: 'post-483',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'truncateToFit',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/26/truncating-text-in-the-flex-label-control-using-the-truncatetofit-property/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Listening for the link event in a Flex Label control</title>
		<link>http://blog.flexexamples.com/2008/01/26/listening-for-the-link-event-in-a-flex-label-control/</link>
		<comments>http://blog.flexexamples.com/2008/01/26/listening-for-the-link-event-in-a-flex-label-control/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 08:49:21 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Label]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[selectable]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/26/listening-for-the-link-event-in-a-flex-label-control/</guid>
		<description><![CDATA[<p>The following example shows how you can use the link event with the Label control in Flex to handle hyperlinks embedded within a string of text. By using the &#8220;event:&#8221; prefix in the href property of an anchor (&#60;a /&#62;) tag, you can handle links within your Flex application, use the ExternalInterface API to call [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the <code>link</code> event with the Label control in Flex to handle hyperlinks embedded within a string of text. By using the &#8220;event:&#8221; prefix in the <code>href</code> property of an anchor (&lt;a /&gt;) tag, you can handle links within your Flex application, use the ExternalInterface API to call JavaScript from Flex, or do pretty much whatever else you want.</p>
<p>Full code after the jump.</p>
<p><span id="more-481"></span></p>
<p class="alert">The Label control must have the <code>selectable</code> property set to <code>true</code> to generate the <code>link</code> event.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_link_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/26/listening-for-the-link-event-in-a-flex-label-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

            private function lbl_initialize():void {
                lbl.htmlText = "For more information on Flex, see &lt;u&gt;&lt;a href='event:flex.org'&gt;http://www.flex.org/&lt;/a&gt;&lt;/u&gt;.";            }

            private function lbl_link(evt:TextEvent):void {
                Alert.show(evt.toString(), evt.text);

                switch (evt.text) {
                    case "flex.org":
                        // You clicked the flex.org link.
                        break;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Label id="lbl"
            selectable="true"
            initialize="lbl_initialize();"
            link="lbl_link(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Label_link_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/Label_link_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>Another useful little tip when dealing with HTML text, is to put your HTML into an external file, and then embed it into your application using &lt;mx:String /&gt;, as seen in the following snippet:</p>
<pre class="code">
<strong style="color:red;">&lt;mx:String id=&quot;str&quot; source=&quot;text.html&quot; /&gt;</strong>

&lt;mx:Label id=&quot;lbl&quot;
        <strong style="color:red;">htmlText=&quot;{str}&quot;</strong>
        selectable=&quot;true&quot;
        link=&quot;lbl_link(event);&quot; /&gt;
</pre>
<p>And then your text.html file would look like the following:</p>
<pre class="code">
&lt;p&gt;For more information on Flex, see &lt;u&gt;&lt;a href="event:flex.org"&gt;http://www.flex.org/&lt;/a&gt;&lt;/u&gt;.&lt;/p&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Listening for the link event in a Flex Label control on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/26/listening-for-the-link-event-in-a-flex-label-control/',contentID: 'post-481',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'event,link,selectable',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/26/listening-for-the-link-event-in-a-flex-label-control/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

