<?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; getStyleDeclaration()</title>
	<atom:link href="http://blog.flexexamples.com/tag/getstyledeclaration/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>Creating a stacked Spark Form container in Flex Hero</title>
		<link>http://blog.flexexamples.com/2010/08/30/creating-a-stacked-spark-form-container-in-flex-hero/</link>
		<comments>http://blog.flexexamples.com/2010/08/30/creating-a-stacked-spark-form-container-in-flex-hero/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 07:12:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Form (Spark)]]></category>
		<category><![CDATA[FormHeading (Spark)]]></category>
		<category><![CDATA[FormItem (Spark)]]></category>
		<category><![CDATA[CSSStyleDeclaration]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[Hero]]></category>
		<category><![CDATA[setStyle()]]></category>
		<category><![CDATA[skinClass]]></category>
		<category><![CDATA[styleManager]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3312</guid>
		<description><![CDATA[<p>The following example shows how you can create a stacked Spark Form, FormHeading, and FormItem in Spark Hero by setting a the skinClass to the StackedFormSkin, StackedFormHeadingSkin, and StackedFormItem skins respectively.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/08/30/creating-a-stacked-spark-form-container-in-flex-hero/ --&#62; &#60;s:Application name=&#34;Spark_Form_skinClass_StackedFormSkin_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#60;s:layout&#62; &#60;s:VerticalLayout horizontalAlign=&#34;center&#34; verticalAlign=&#34;middle&#34; /&#62; &#60;/s:layout&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a stacked Spark Form, FormHeading, and FormItem in Spark Hero by setting a the <code>skinClass</code> to the StackedFormSkin, StackedFormHeadingSkin, and StackedFormItem skins respectively.</p>
<p><span id="more-3312"></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/08/30/creating-a-stacked-spark-form-container-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_Form_skinClass_StackedFormSkin_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:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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 s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        s|Form {
            skinClass: ClassReference(&quot;spark.skins.spark.StackedFormSkin&quot;);
        }
&nbsp;
        s|FormHeading {
            skinClass: ClassReference(&quot;spark.skins.spark.StackedFormHeadingSkin&quot;);
        }
&nbsp;
        s|FormItem {
            skinClass: ClassReference(&quot;spark.skins.spark.StackedFormItemSkin&quot;);
        }
    <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:Form</span> id=<span style="color: #ff0000;">&quot;frm&quot;</span> defaultButton=<span style="color: #ff0000;">&quot;{submitBtn}&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;#EEEEEE&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormHeading</span> label=<span style="color: #ff0000;">&quot;Spark Form Heading&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;haloSilver&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;1.&quot;</span> label=<span style="color: #ff0000;">&quot;Username:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;user@domain.com&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;username&quot;</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:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;2.&quot;</span> label=<span style="color: #ff0000;">&quot;Password:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;weak&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password1&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</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:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;3.&quot;</span> label=<span style="color: #ff0000;">&quot;Confirm password:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> color=<span style="color: #ff0000;">&quot;blue&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password2&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</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:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;resetBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Reset&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;submitBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Submit&quot;</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>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>You can also toggle the default Spark FormSkin skin and Spark StackedFormSkin at runtime using ActionScript, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/08/30/creating-a-stacked-spark-form-container-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_Form_skinClass_StackedFormSkin_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:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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:CheckBox</span> id=<span style="color: #ff0000;">&quot;cb&quot;</span> label=<span style="color: #ff0000;">&quot;Stacked forms?&quot;</span> change=<span style="color: #ff0000;">&quot;cb_changeHandler(event);&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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import spark.skins.spark.FormHeadingSkin;</span>
<span style="color: #000000;">            import spark.skins.spark.FormItemSkin;</span>
<span style="color: #000000;">            import spark.skins.spark.FormSkin;</span>
<span style="color: #000000;">            import spark.skins.spark.StackedFormHeadingSkin;</span>
<span style="color: #000000;">            import spark.skins.spark.StackedFormItemSkin;</span>
<span style="color: #000000;">            import spark.skins.spark.StackedFormSkin;</span>
&nbsp;
<span style="color: #000000;">            protected function cb_changeHandler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var formCSS:CSSStyleDeclaration = styleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.Form&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var formHeadingCSS:CSSStyleDeclaration = styleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.FormHeading&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var formItemCSS:CSSStyleDeclaration = styleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.FormItem&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>cb.selected<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    formCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skinClass&quot;</span>, StackedFormSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                    formHeadingCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skinClass&quot;</span>, StackedFormHeadingSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                    formItemCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skinClass&quot;</span>, StackedFormItemSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    formCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skinClass&quot;</span>, FormSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                    formHeadingCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skinClass&quot;</span>, FormHeadingSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                    formItemCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skinClass&quot;</span>, FormItemSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Form</span> id=<span style="color: #ff0000;">&quot;frm&quot;</span> defaultButton=<span style="color: #ff0000;">&quot;{submitBtn}&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;#EEEEEE&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormHeading</span> label=<span style="color: #ff0000;">&quot;Spark Form Heading&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;haloSilver&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;1.&quot;</span> label=<span style="color: #ff0000;">&quot;Username:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;user@domain.com&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;username&quot;</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:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;2.&quot;</span> label=<span style="color: #ff0000;">&quot;Password:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;weak&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password1&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</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:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;3.&quot;</span> label=<span style="color: #ff0000;">&quot;Confirm password:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> color=<span style="color: #ff0000;">&quot;blue&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password2&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</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:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;resetBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Reset&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;submitBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Submit&quot;</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>
&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: 'Creating a stacked Spark Form container in Flex Hero on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/08/30/creating-a-stacked-spark-form-container-in-flex-hero/',contentID: 'post-3312',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'CSSStyleDeclaration,getStyleDeclaration(),Hero,setStyle(),skinClass,styleManager',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/08/30/creating-a-stacked-spark-form-container-in-flex-hero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling tooltips in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/08/30/styling-tooltips-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/08/30/styling-tooltips-in-flex-4/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 13:34:32 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[ToolTip]]></category>
		<category><![CDATA[CSSStyleDeclaration]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[needsSWF]]></category>
		<category><![CDATA[setStyle()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1769</guid>
		<description><![CDATA[<p>The following example shows how you can customize the appearance of a ToolTip in Flex 4 by overriding the ToolTip selector in an &#60;fx:Style/&#62; block, or using the StyleManager in ActionScript.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/08/30/styling-tooltips-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_ToolTip_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 s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace mx [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can customize the appearance of a ToolTip in Flex 4 by overriding the ToolTip selector in an &lt;fx:Style/&gt; block, or using the StyleManager in ActionScript.</p>
<p>Full code after the jump.</p>
<p><span id="more-1769"></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/08/30/styling-tooltips-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_ToolTip_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 s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        mx|ToolTip {
            backgroundAlpha: 1.0;
            backgroundColor: black;
            color: white;
            cornerRadius: 0;
            fontSize: 24;
        }
    <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:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">            label=<span style="color: #ff0000;">&quot;Spark Button&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;btn.toolTip = mx_internal::VERSION;&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_ToolTip_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_ToolTip_test/bin/main.html" width="100%" height="150"></iframe></p>
<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>Or you can set the ToolTip CSS declaration using ActionScript, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/30/styling-tooltips-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_ToolTip_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var cssDecl:CSSStyleDeclaration = StyleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.ToolTip&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!cssDecl<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    cssDecl = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.ToolTip&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                cssDecl.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundAlpha&quot;</span>, <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cssDecl.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, <span style="color: #ff0000;">&quot;black&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cssDecl.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>, <span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cssDecl.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;cornerRadius&quot;</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cssDecl.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontSize&quot;</span>, <span style="color: #cc66cc;">24</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">            label=<span style="color: #ff0000;">&quot;Spark Button&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;btn.toolTip = mx_internal::VERSION;&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling tooltips in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/08/30/styling-tooltips-in-flex-4/',contentID: 'post-1769',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'CSSStyleDeclaration,getStyleDeclaration(),Gumbo,needsSWF,setStyle()',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/08/30/styling-tooltips-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using a CFF embedded font with a Halo DataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 13:32:21 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[DataGridColumn]]></category>
		<category><![CDATA[defaultDataGridItemRenderer]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[TLFDataGridItemRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1695</guid>
		<description><![CDATA[<p>The following example shows how you can use a CFF embedded font with a Halo DataGrid container by setting the itemRenderer property or defaultDataGridItemRenderer style to the mx.controls.dataGridClasses.TLFDataGridItemRenderer class.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_DataGrid_TLFDataGridItemRenderer_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/halo&#34;&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace mx &#34;library://ns.adobe.com/flex/halo&#34;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use a CFF embedded font with a Halo DataGrid container by setting the <code>itemRenderer</code> property or <code>defaultDataGridItemRenderer</code> style to the mx.controls.dataGridClasses.TLFDataGridItemRenderer class.</p>
<p>Full code after the jump.</p>
<p><span id="more-1695"></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/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-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;Halo_DataGrid_TLFDataGridItemRenderer_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/halo&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 s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        @font-face {
            src: url(&quot;assets/Arial.ttf&quot;);
            fontFamily: ArialCFF;
            embedAsCFF: true;
        }
    <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:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span></span>
<span style="color: #000000;">                itemRenderer=<span style="color: #ff0000;">&quot;mx.controls.dataGridClasses.TLFDataGridItemRenderer&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;7. One&quot;</span> c2=<span style="color: #ff0000;">&quot;7. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;8. One&quot;</span> c2=<span style="color: #ff0000;">&quot;8. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;9. One&quot;</span> c2=<span style="color: #ff0000;">&quot;9. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> text=<span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&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>You can set the <code>defaultDataGridItemRenderer</code> style in MXML, 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/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-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;Halo_DataGrid_TLFDataGridItemRenderer_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/halo&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 s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        @font-face {
            src: url(&quot;assets/Arial.ttf&quot;);
            fontFamily: ArialCFF;
            embedAsCFF: true;
        }
    <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:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span></span>
<span style="color: #000000;">                defaultDataGridItemRenderer=<span style="color: #ff0000;">&quot;mx.controls.dataGridClasses.TLFDataGridItemRenderer&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;7. One&quot;</span> c2=<span style="color: #ff0000;">&quot;7. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;8. One&quot;</span> c2=<span style="color: #ff0000;">&quot;8. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;9. One&quot;</span> c2=<span style="color: #ff0000;">&quot;9. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> text=<span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&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>Or, you also set the <code>defaultDataGridItemRenderer</code> style globally in 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/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-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;Halo_DataGrid_TLFDataGridItemRenderer_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/halo&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 s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        @font-face {
            src: url(&quot;assets/Arial.ttf&quot;);
            fontFamily: ArialCFF;
            embedAsCFF: true;
        }
&nbsp;
        mx|DataGrid {
            defaultDataGridItemRenderer: ClassReference(&quot;mx.controls.dataGridClasses.TLFDataGridItemRenderer&quot;);
            fontFamily: ArialCFF;
        }
&nbsp;
        s|SimpleText {
            fontFamily: ArialCFF;
        }
    <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:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;7. One&quot;</span> c2=<span style="color: #ff0000;">&quot;7. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;8. One&quot;</span> c2=<span style="color: #ff0000;">&quot;8. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;9. One&quot;</span> c2=<span style="color: #ff0000;">&quot;9. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> text=<span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&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>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-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;Halo_DataGrid_TLFDataGridItemRenderer_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/halo&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.collections.ArrayList;</span>
<span style="color: #000000;">            import mx.controls.DataGrid;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.DataGridColumn;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.TLFDataGridItemRenderer;</span>
<span style="color: #000000;">            import spark.components.VGroup;</span>
<span style="color: #000000;">            import spark.primitives.SimpleText;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;assets/Arial.ttf&quot;</span>,</span>
<span style="color: #000000;">                    fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span>,</span>
<span style="color: #000000;">                    embedAsCFF=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private const ArialEmbeddedFont:Class;</span>
&nbsp;
<span style="color: #000000;">            private var dataGrid:DataGrid;</span>
<span style="color: #000000;">            private var simpleTxt:SimpleText;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var dp:ArrayList = new ArrayList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;1. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;1. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;2. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;2. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;3. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;3. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;4. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;4. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;5. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;5. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;6. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;6. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;7. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;7. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;8. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;8. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;9. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;9. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var cols:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c2&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                dataGrid = new DataGrid<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dataGrid.columns = cols;</span>
<span style="color: #000000;">                dataGrid.dataProvider = dp;</span>
<span style="color: #000000;">                dataGrid.itemRenderer = new ClassFactory<span style="color: #66cc66;">&#40;</span>TLFDataGridItemRenderer<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dataGrid.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                simpleTxt = new SimpleText<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                simpleTxt.text = <span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span>;</span>
<span style="color: #000000;">                simpleTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var vGr:VGroup = new VGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>dataGrid<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>simpleTxt<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>vGr<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you can use the StyleManager class and set the <code>defaultDataGridItemRenderer</code> style globally, 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/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-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;Halo_DataGrid_TLFDataGridItemRenderer_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/halo&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.collections.ArrayList;</span>
<span style="color: #000000;">            import mx.controls.DataGrid;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.DataGridColumn;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.TLFDataGridItemRenderer;</span>
<span style="color: #000000;">            import spark.components.VGroup;</span>
<span style="color: #000000;">            import spark.primitives.SimpleText;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;assets/Arial.ttf&quot;</span>,</span>
<span style="color: #000000;">                    fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span>,</span>
<span style="color: #000000;">                    embedAsCFF=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private const ArialEmbeddedFont:Class;</span>
&nbsp;
<span style="color: #000000;">            private var dataGrid:DataGrid;</span>
<span style="color: #000000;">            private var simpleTxt:SimpleText;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var dgStyles:CSSStyleDeclaration = StyleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.DataGrid&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!dgStyles<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> /* null check */</span>
<span style="color: #000000;">                    dgStyles = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.DataGrid&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                dgStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;defaultDataGridItemRenderer&quot;</span>, TLFDataGridItemRenderer<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dgStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var stStyles:CSSStyleDeclaration = StyleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.primitives.SimpleText&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!stStyles<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> /* null check */</span>
<span style="color: #000000;">                    stStyles = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.primitives.SimpleText&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                stStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var dp:ArrayList = new ArrayList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;1. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;1. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;2. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;2. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;3. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;3. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;4. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;4. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;5. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;5. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;6. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;6. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;7. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;7. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;8. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;8. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;9. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;9. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var cols:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c2&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                dataGrid = new DataGrid<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dataGrid.columns = cols;</span>
<span style="color: #000000;">                dataGrid.dataProvider = dp;</span>
&nbsp;
<span style="color: #000000;">                simpleTxt = new SimpleText<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                simpleTxt.text = <span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span>;</span>
&nbsp;
<span style="color: #000000;">                var vGr:VGroup = new VGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>dataGrid<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>simpleTxt<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>vGr<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using a CFF embedded font with a Halo DataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/',contentID: 'post-1695',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'defaultDataGridItemRenderer,getStyleDeclaration(),Gumbo,itemRenderer,TLFDataGridItemRenderer',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/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Styling Alert controls in Flex using the StyleManager class and setStyle() method (Flex 4 Edition)</title>
		<link>http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/</link>
		<comments>http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 06:59:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[CSSStyleDeclaration]]></category>
		<category><![CDATA[StyleManager]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[setStyle()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/">&#8220;Styling Alert controls in Flex using the StyleManager class and setStyle() methods&#8221;</a>, we saw how to style a Flex Alert control using the static StyleManager.getStyleDeclaration() method, and the setStyle() method.</p> <p>The following example shows how you can do the same thing using the beta Flex 4 SDK by passing a [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/">&#8220;Styling Alert controls in Flex using the StyleManager class and setStyle() methods&#8221;</a>, we saw how to style a Flex Alert control using the static <code>StyleManager.getStyleDeclaration()</code> method, and the <code>setStyle()</code> method.</p>
<p>The following example shows how you can do the same thing using the beta Flex 4 SDK by passing a fully qualified class name to the static <code>getStyleDeclaration()</code> method.</p>
<p><span id="more-1040"></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/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_Alert_chromeColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #000000;">            private var alert:Alert;</span>
<span style="color: #000000;">            private var alertCSS:CSSStyleDeclaration;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                alertCSS = styleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.Alert&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function showAlert<span style="color: #66cc66;">&#40;</span>color:Object<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                alertCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;modalTransparencyColor&quot;</span>, color<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                alertCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;chromeColor&quot;</span>, color<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                alert = Alert.show<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span>, <span style="color: #ff0000;">&quot;Alert title&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Red&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;red&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('red');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Orange&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;haloOrange&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('haloOrange');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Yellow&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;yellow&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('yellow');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Green&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;haloGreen&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('haloGreen');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Blue&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;haloBlue&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('haloBlue');&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>
&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_Alert_chromeColor_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_Alert_chromeColor_test/main.html" width="100%" height="300"></iframe></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: 'Styling Alert controls in Flex using the StyleManager class and setStyle() method (Flex 4 Edition) on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/',contentID: 'post-1040',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getStyleDeclaration(),Gumbo,setStyle()',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/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dynamically styling error tips in Flex</title>
		<link>http://blog.flexexamples.com/2008/09/26/dynamically-styling-error-tips-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/09/26/dynamically-styling-error-tips-in-flex/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 06:34:15 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[StyleManager]]></category>
		<category><![CDATA[ToolTip]]></category>
		<category><![CDATA[.errorTip]]></category>
		<category><![CDATA[borderColor]]></category>
		<category><![CDATA[errorColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/26/dynamically-styling-error-tips-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/05/22/changing-the-background-color-of-an-error-tip-in-flex/">&#8220;Changing the background color of an error tip in Flex&#8221;</a>, we saw how you could change the background color of a Flex error tip by setting the borderColor style on the .errorTip CSS selector.</p> <p>The following example shows how you can style the Flex .errorTip style dynamically using ActionScript using [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/05/22/changing-the-background-color-of-an-error-tip-in-flex/">&#8220;Changing the background color of an error tip in Flex&#8221;</a>, we saw how you could change the background color of a Flex error tip by setting the <code>borderColor</code> style on the <code>.errorTip</code> CSS selector.</p>
<p>The following example shows how you can style the Flex <code>.errorTip</code> style dynamically using ActionScript using the static <code>StyleManager.getStyleDeclaration()</code> and <code>setStyle()</code> methods.</p>
<p>Full code after the jump.</p>
<p><span id="more-809"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/errorTip_borderColor_test_2/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/09/26/dynamically-styling-error-tips-in-flex/ --&gt;
&lt;mx:Application name="errorTip_borderColor_test_2"
        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;

            private function comboBox_valueCommit(evt:FlexEvent):void {
                if (comboBox.selectedIndex &gt; -1) {
                    var value:String = comboBox.selectedItem.data;
                    var cssObj:CSSStyleDeclaration;
                    cssObj = StyleManager.getStyleDeclaration(".errorTip");
                    cssObj.setStyle("borderColor", value);
                    textInput.setStyle("errorColor", value);
                    textInput.errorString = errStr;
                } else {
                    textInput.errorString = "";
                }
            }

            private function button_click(evt:MouseEvent):void {
                comboBox.selectedIndex = -1;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red"    data="red" /&gt;
        &lt;mx:Object label="Orange" data="haloOrange" /&gt;
        &lt;mx:Object label="Yellow" data="yellow" /&gt;
        &lt;mx:Object label="Green"  data="haloGreen" /&gt;
        &lt;mx:Object label="Blue"   data="haloBlue" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:String id="errStr"&gt;Oh noes, an errata!&lt;/mx:String&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="errorColor:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="{arr}"
                        prompt="Please select a color:"
                        valueCommit="comboBox_valueCommit(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
        &lt;mx:Spacer width="100%" /&gt;
        &lt;mx:Button label="Deselect ComboBox"
                click="button_click(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextInput id="textInput" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/errorTip_borderColor_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/errorTip_borderColor_test_2/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Dynamically styling error tips in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/26/dynamically-styling-error-tips-in-flex/',contentID: 'post-809',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '.errorTip,borderColor,errorColor,getStyleDeclaration()',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/09/26/dynamically-styling-error-tips-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting the letter spacing in the RichTextEditor control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/22/setting-the-letter-spacing-in-the-richtexteditor-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/22/setting-the-letter-spacing-in-the-richtexteditor-control-in-flex/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 03:55:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CSSStyleDeclaration]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[RichTextEditor]]></category>
		<category><![CDATA[StyleManager]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[letterSpacing]]></category>
		<category><![CDATA[textAreaStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/22/setting-the-letter-spacing-in-the-richtexteditor-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the letter spacing in a Flex RichTextEditor control by setting the textAreaStyleName and letterSpacing styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_textAreaStyleName_letterSpacing_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/04/22/setting-the-letter-spacing-in-the-richtexteditor-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; .myTextAreaStyleName { fontFamily: Courier; letterSpacing: 3; /* pixels */ } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the letter spacing in a Flex RichTextEditor control by setting the <code>textAreaStyleName</code> and <code>letterSpacing</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-604"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_textAreaStyleName_letterSpacing_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/04/22/setting-the-letter-spacing-in-the-richtexteditor-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;
        .myTextAreaStyleName {
            fontFamily: Courier;
            letterSpacing: 3; /* pixels */
        }
    &lt;/mx:Style&gt;

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

            private function slider_change(evt:SliderEvent):void {
                var cssStyle:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myTextAreaStyleName");
                cssStyle.setStyle("letterSpacing", evt.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:String id="str" source="lorem.txt" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="letterSpacing:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        maximum="20"
                        value="3"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="1"
                        change="slider_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:RichTextEditor id="richTextEditor"
            text="{str}"
            textAreaStyleName="myTextAreaStyleName"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_textAreaStyleName_letterSpacing_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/RichTextEditor_textAreaStyleName_letterSpacing_test/bin/main.html" width="100%" height="450"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the letter spacing in the RichTextEditor control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/22/setting-the-letter-spacing-in-the-richtexteditor-control-in-flex/',contentID: 'post-604',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getStyleDeclaration(),letterSpacing,textAreaStyleName',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/04/22/setting-the-letter-spacing-in-the-richtexteditor-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Styling Alert controls in Flex using the StyleManager class and setStyle() methods</title>
		<link>http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/</link>
		<comments>http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 05:13:46 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[CSSStyleDeclaration]]></category>
		<category><![CDATA[StyleManager]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[setStyle()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/</guid>
		<description><![CDATA[<p>The following example shows how you can style a Flex Alert control using the static StyleManager.getStyleDeclaration() method, and the setStyle() method.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/StyleManager_getStyleDeclaration_Alert_setStyle_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.controls.Alert; import mx.styles.StyleManager; private var alert:Alert; private var alertCSS:CSSStyleDeclaration; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can style a Flex Alert control using the static <code>StyleManager.getStyleDeclaration()</code> method, and the <code>setStyle()</code> method.</p>
<p>Full code after the jump.</p>
<p><span id="more-536"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/StyleManager_getStyleDeclaration_Alert_setStyle_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/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

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

            private var alert:Alert;
            private var alertCSS:CSSStyleDeclaration;

            private function init():void {
                alertCSS = StyleManager.getStyleDeclaration("Alert");
            }

            private function showAlert(color:Object):void {
                alertCSS.setStyle("modalTransparencyColor", color);
                alertCSS.setStyle("themeColor", color);
                alert = Alert.show("The quick brown fox...");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="Red"
                themeColor="red"
                click="showAlert('red');" /&gt;
        &lt;mx:Button label="Orange"
                themeColor="haloOrange"
                click="showAlert('haloOrange');" /&gt;
        &lt;mx:Button label="Yellow"
                themeColor="yellow"
                click="showAlert('yellow');" /&gt;
        &lt;mx:Button label="Green"
                themeColor="haloGreen"
                click="showAlert('haloGreen');" /&gt;
        &lt;mx:Button label="Blue"
                themeColor="haloBlue"
                click="showAlert('haloBlue');" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/StyleManager_getStyleDeclaration_Alert_setStyle_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/StyleManager_getStyleDeclaration_Alert_setStyle_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling Alert controls in Flex using the StyleManager class and setStyle() methods on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/',contentID: 'post-536',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getStyleDeclaration(),setStyle()',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/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Changing text alignment in an Flex Accordion header</title>
		<link>http://blog.flexexamples.com/2007/09/13/changing-text-alignment-in-an-flex-accordion-header/</link>
		<comments>http://blog.flexexamples.com/2007/09/13/changing-text-alignment-in-an-flex-accordion-header/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 05:56:17 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Accordion]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[StyleManager]]></category>
		<category><![CDATA[getChildren()]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[setStyleDeclaration()]]></category>
		<category><![CDATA[textAlign]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/13/changing-text-alignment-in-an-flex-accordion-header/</guid>
		<description><![CDATA[<p>The following example shows how you can use the textAlign style to control the text alignment of a label in an Accordion header.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_textAlign_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/13/changing-text-alignment-in-an-flex-accordion-header/ --&#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; .MyHeaderStyle { color: haloBlue; fontWeight: bold; textAlign: left; textRollOverColor: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the <code>textAlign</code> style to control the text alignment of a label in an Accordion header.</p>
<p>Full code after the jump.</p>
<p><span id="more-178"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_textAlign_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/09/13/changing-text-alignment-in-an-flex-accordion-header/ --&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;
        .MyHeaderStyle {
            color: haloBlue;
            fontWeight: bold;
            textAlign: left;
            textRollOverColor: haloOrange;
            textSelectedColor: black;
            icon: Embed(source="assets/asterisk_orange.png");
        }
    &lt;/mx:Style&gt;

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

            private function init():void {
                comboBox.dataProvider = accordion.getChildren()
            }

            private function comboBox_change(evt:ListEvent):void {
                accordion.selectedIndex = comboBox.selectedIndex;
            }

            private function accordion_change(evt:IndexChangedEvent):void {
                comboBox.selectedIndex = accordion.selectedIndex;
            }

            private function changeTextAlign(evt:ListEvent):void {
                var cssDecl:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".MyHeaderStyle");
                cssDecl.setStyle("textAlign", evt.currentTarget.selectedItem);
                StyleManager.setStyleDeclaration(".MyHeaderStyle", cssDecl, false);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Label text="Selected child:" /&gt;
        &lt;mx:ComboBox id="comboBox"
                change="comboBox_change(event);"&gt;
        &lt;/mx:ComboBox&gt;

        &lt;mx:Spacer width="50" /&gt;

        &lt;mx:Label text="textAlign:" /&gt;
        &lt;mx:ComboBox change="changeTextAlign(event)"&gt;
            &lt;mx:dataProvider&gt;
                &lt;mx:String&gt;left&lt;/mx:String&gt;
                &lt;mx:String&gt;center&lt;/mx:String&gt;
                &lt;mx:String&gt;right&lt;/mx:String&gt;
            &lt;/mx:dataProvider&gt;
        &lt;/mx:ComboBox&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Accordion id="accordion"
            headerStyleName="MyHeaderStyle"
            themeColor="haloSilver"
            width="100%"
            height="100%"
            change="accordion_change(event);"&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:VBox label="Five" /&gt;
    &lt;/mx:Accordion&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Accordion_textAlign_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_textAlign_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing text alignment in an Flex Accordion header on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/13/changing-text-alignment-in-an-flex-accordion-header/',contentID: 'post-178',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getChildren(),getStyleDeclaration(),icon,setStyleDeclaration(),textAlign',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/09/13/changing-text-alignment-in-an-flex-accordion-header/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Building a simple style browser in Flex 3</title>
		<link>http://blog.flexexamples.com/2007/09/12/building-a-simple-style-browser-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2007/09/12/building-a-simple-style-browser-in-flex-3/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 23:38:28 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CSSStyleDeclaration]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[StyleManager]]></category>
		<category><![CDATA[Styles]]></category>
		<category><![CDATA[defaultFactory()]]></category>
		<category><![CDATA[selectors]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/12/building-a-simple-style-browser-in-flex-3/</guid>
		<description><![CDATA[<p>In my previous post, &#8220;<a href="http://blog.flexexamples.com/2007/09/12/introducing-the-stylemanagerselectors-property-in-flex-3/">Introducing the StyleManager.selectors property in Flex 3</a>&#8220;, we looked at the new StyleManager class&#8217;s static selectors property introduced in Flex 3.</p> <p>This example shows how you can make a simple app which lets you loop over styles currently registered with the StyleManager and display their current style names and values.</p> [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post, &#8220;<a href="http://blog.flexexamples.com/2007/09/12/introducing-the-stylemanagerselectors-property-in-flex-3/">Introducing the StyleManager.selectors property in Flex 3</a>&#8220;, we looked at the new StyleManager class&#8217;s static <code>selectors</code> property introduced in Flex 3.</p>
<p>This example shows how you can make a simple app which lets you loop over styles currently registered with the StyleManager and display their current style names and values.</p>
<p>Full code after the jump.</p>
<p><span id="more-167"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/StyleManager_selectors_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/12/building-a-simple-style-browser-in-flex-3/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init()"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.styles.StyleManager;
            import mx.controls.ComboBox;

            private function init():void {
                arr = StyleManager.selectors;
                arr.sort(Array.CASEINSENSITIVE);
            }

            private function list_change(evt:Event):void {
                var styleName:String = String(ComboBox(evt.currentTarget).selectedItem);
                var cssStyle:CSSStyleDeclaration = StyleManager.getStyleDeclaration(styleName);
                var obj:Object = new cssStyle.defaultFactory();
                var styles:Array = [];
                var key:String;

                for (key in obj) {
                    styles.push({key:key, value:obj[key]});
                }

                styles.sortOn("key", Array.CASEINSENSITIVE);
                dataGrid.dataProvider = styles;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Label text="selectors:" /&gt;
        &lt;mx:ComboBox id="comboBox"
                prompt="Please select a style..."
                dataProvider="{arr}"
                width="250"
                change="list_change(event)" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid id="dataGrid"
            rowHeight="22"
            width="300"
            verticalScrollPolicy="on"&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField="key"
                    headerText="Style:"
                    itemRenderer="mx.controls.Label" /&gt;
            &lt;mx:DataGridColumn dataField="value"
                    headerText="Value:"
                    itemRenderer="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/StyleManager_selectors_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/StyleManager_selectors_test_2/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Building a simple style browser in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/12/building-a-simple-style-browser-in-flex-3/',contentID: 'post-167',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'defaultFactory(),getStyleDeclaration(),selectors',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/09/12/building-a-simple-style-browser-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

