<?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; borderSkin</title>
	<atom:link href="http://blog.flexexamples.com/tag/borderskin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting a gradient background fill on a Halo TextArea control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/10/24/setting-a-gradient-background-fill-on-a-halo-textarea-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/10/24/setting-a-gradient-background-fill-on-a-halo-textarea-control-in-flex-4/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 18:19:51 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[GradientEntry]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[lineargradient]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2074</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/06/17/setting-the-background-fill-color-on-a-halo-textarea-control-in-flex-4/">&#8220;Setting the background fill color on a Halo TextArea control in Flex 4&#8243;</a>, we saw how you could set the background fill color on the Halo TextArea control (with default Spark skin) in Flex 4 by setting the contentBackgroundColor style.</p> <p>The following example shows how you can create a linear [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/06/17/setting-the-background-fill-color-on-a-halo-textarea-control-in-flex-4/">&#8220;Setting the background fill color on a Halo TextArea control in Flex 4&#8243;</a>, we saw how you could set the background fill color on the Halo TextArea control (with default Spark skin) in Flex 4 by setting the <code>contentBackgroundColor</code> style.</p>
<p>The following example shows how you can create a linear gradient background on a Halo/MX TextArea control in Flex 4 by creating a custom border skin with a LinearGradient fill and setting the <code>borderSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-2074"></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/10/24/setting-a-gradient-background-fill-on-a-halo-textarea-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_TextArea_SparkSkin_background_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;mx:TextArea</span> id=<span style="color: #ff0000;">&quot;ta&quot;</span></span>
<span style="color: #000000;">            text=<span style="color: #ff0000;">&quot;{Capabilities.serverString}&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;skins.CustomBorderSkin&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;200&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>And the custom border skin, <em>skins/CustomBorderSkin.mxml</em>, is as follows:</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/10/24/setting-a-gradient-background-fill-on-a-halo-textarea-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;local:SparkSkinForHalo</span> name=<span style="color: #ff0000;">&quot;CustomBorderSkin&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:local=<span style="color: #ff0000;">&quot;mx.skins.spark.*&quot;</span></span>
<span style="color: #000000;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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.core.EdgeMetrics;</span>
<span style="color: #000000;">            import mx.core.IUIComponent;</span>
<span style="color: #000000;">            import mx.graphics.RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">            /* Define the skin elements that should not be colorized. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span>return exclusions;<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">            static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span>return contentFill<span style="color: #66cc66;">&#125;</span>;</span>
&nbsp;
<span style="color: #000000;">            /* Define the border item. */</span>
<span style="color: #000000;">            static private const borderItem:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;borderStroke&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override protected function get borderItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span>return borderItem;<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            override protected function get defaultBorderItemColor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:uint <span style="color: #66cc66;">&#123;</span>return getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderColor&quot;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            override protected function get defaultBorderAlpha<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Number <span style="color: #66cc66;">&#123;</span>return getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderAlpha&quot;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            static private const metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            public var cornerRadius:Number = <span style="color: #cc66cc;">0</span>;</span>
&nbsp;
<span style="color: #000000;">            private var dropShadow:RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">            public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderVisible&quot;</span><span style="color: #66cc66;">&#41;</span> == false ||</span>
<span style="color: #000000;">                    getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderStyle&quot;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;none&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    return EdgeMetrics.EMPTY</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                return metrics;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return null;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return false;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function initializationComplete<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                useBaseColor = true;</span>
<span style="color: #000000;">                super.initializationComplete<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                // Force a redraw to clear any existing shadow, and to force a redraw of the</span>
<span style="color: #000000;">                // border/background.</span>
<span style="color: #000000;">                redrawRequested = true;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderVisible&quot;</span><span style="color: #66cc66;">&#41;</span> == false || getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderStyle&quot;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;none&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    border.visible = false;</span>
<span style="color: #000000;">                    background.left = background.top = background.right = background.bottom = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    border.visible = true;</span>
<span style="color: #000000;">                    background.left = background.top = background.right = background.bottom = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                border.radiusX = cornerRadius;</span>
<span style="color: #000000;">                background.radiusX = cornerRadius;</span>
&nbsp;
<span style="color: #000000;">                super.updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>parent &amp;&amp; parent is IUIComponent &amp;&amp; !IUIComponent<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.enabled<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    alpha = <span style="color: #cc66cc;">0.5</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    alpha = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                // Draw drop shadow, if needed</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowVisible&quot;</span><span style="color: #66cc66;">&#41;</span> == false || width == <span style="color: #cc66cc;">0</span> || height == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    return;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                // Create a RectangularDropShadow object, set its properties,</span>
<span style="color: #000000;">                // and draw the shadow</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!dropShadow<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    dropShadow = new RectangularDropShadow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                dropShadow.distance = <span style="color: #cc66cc;">5</span>;</span>
<span style="color: #000000;">                dropShadow.angle = <span style="color: #cc66cc;">90</span>;</span>
<span style="color: #000000;">                dropShadow.color = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                dropShadow.alpha = <span style="color: #cc66cc;">0.8</span>;</span>
<span style="color: #000000;">                dropShadow.blurX = <span style="color: #cc66cc;">20</span>;</span>
<span style="color: #000000;">                dropShadow.blurY = <span style="color: #cc66cc;">20</span>;</span>
&nbsp;
<span style="color: #000000;">                // Clear out any pending line style</span>
<span style="color: #000000;">                graphics.lineStyle<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dropShadow.drawShadow<span style="color: #66cc66;">&#40;</span>graphics, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, width, height<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 getDropShadowAngle<span style="color: #66cc66;">&#40;</span>distance:Number, direction:String<span style="color: #66cc66;">&#41;</span>:Number</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>direction == <span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    return distance <span style="color: #7400FF;">&gt;</span></span>= 0 ? 135 : 225;
                } else if (direction == &quot;right&quot;) {
                    return distance &gt;= 0 ? 45 : 315;
                } else { // direction == &quot;center&quot;
                    return distance &gt;= 0 ? 90 : 270;
                }
            }
        ]]&gt;
    <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: #808080; font-style: italic;">&lt;!-- border --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> radiusX=<span style="color: #ff0000;">&quot;0&quot;</span> id=<span style="color: #ff0000;">&quot;border&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> id=<span style="color: #ff0000;">&quot;borderStroke&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</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:GradientEntry</span> color=<span style="color: #ff0000;">&quot;purple&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/local:SparkSkinForHalo</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">The default Spark skins for the MX/Halo controls/containers can be found in the Flex SDK at:<br/>
<em>%Flex SDK%</em>\frameworks\projects\sparkskins\src\mx\skins\spark\*.</p>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_TextArea_SparkSkin_background_test/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_TextArea_SparkSkin_background_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: 'Setting a gradient background fill on a Halo TextArea control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/10/24/setting-a-gradient-background-fill-on-a-halo-textarea-control-in-flex-4/',contentID: 'post-2074',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,GradientEntry,Gumbo,lineargradient',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/10/24/setting-a-gradient-background-fill-on-a-halo-textarea-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing the border from the Halo Tree control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 13:56:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[Tree]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1759</guid>
		<description><![CDATA[<p>The following example shows how you can remove or modify the border on the Halo Tree control (with default Spark skin) in Flex 4 by setting the borderSkin style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Tree_borderSkin_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;mx:Tree id=&#34;tree1&#34; labelField=&#34;@label&#34; showRoot=&#34;true&#34; borderSkin=&#34;{null}&#34; width=&#34;160&#34; horizontalCenter=&#34;0&#34; verticalCenter=&#34;0&#34;&#62; &#60;mx:XMLListCollection [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can remove or modify the border on the Halo Tree control (with default Spark skin) in Flex 4 by setting the <code>borderSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1759"></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>?<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/28/removing-the-border-from-the-halo-tree-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_Tree_borderSkin_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;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;{null}&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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_Tree_borderSkin_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_Tree_borderSkin_test/bin/main.html" width="100%" height="300"></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 modify the Halo Tree border skin, 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>?<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/28/removing-the-border-from-the-halo-tree-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_Tree_borderSkin_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;">        backgroundColor=<span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;skins.CustomBorderSkin&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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>And the custom border skin, <em>skins/CustomBorderSkin.mxml</em>, is as follows:</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/28/removing-the-border-from-the-halo-tree-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;local:SparkSkinForHalo</span> name=<span style="color: #ff0000;">&quot;CustomBorderSkin&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:local=<span style="color: #ff0000;">&quot;mx.skins.spark.*&quot;</span></span>
<span style="color: #000000;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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.core.EdgeMetrics;</span>
<span style="color: #000000;">        import mx.core.IUIComponent;</span>
<span style="color: #000000;">        import mx.graphics.RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">        /* Define the skin elements that should not be colorized. */</span>
<span style="color: #000000;">        static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return exclusions;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">        static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;bgFill&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return contentFill;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        /* Define the border item. */</span>
<span style="color: #000000;">        static private const borderItem:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override protected function get borderItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return borderItem;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        override protected function get defaultBorderItemColor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:uint <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return 0x696969;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        static private const metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">        private var dropShadow:RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">        public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return metrics;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return null;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return false;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            graphics.clear<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            super.updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>parent &amp;&amp; parent is IUIComponent &amp;&amp; !IUIComponent<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.enabled<span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">                alpha = <span style="color: #cc66cc;">0.5</span>;</span>
<span style="color: #000000;">            else</span>
<span style="color: #000000;">                alpha = <span style="color: #cc66cc;">1</span>;</span>
&nbsp;
<span style="color: #000000;">            // Draw drop shadow, if needed</span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowEnabled&quot;</span><span style="color: #66cc66;">&#41;</span> == false ||</span>
<span style="color: #000000;">                getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowEnabled&quot;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;false&quot;</span> ||</span>
<span style="color: #000000;">                width == <span style="color: #cc66cc;">0</span> ||</span>
<span style="color: #000000;">                height == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            // Create a RectangularDropShadow object, set its properties,</span>
<span style="color: #000000;">            // and draw the shadow</span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>!dropShadow<span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">                dropShadow = new RectangularDropShadow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            dropShadow.distance = <span style="color: #cc66cc;">5</span>;</span>
<span style="color: #000000;">            dropShadow.angle = <span style="color: #cc66cc;">90</span>;</span>
<span style="color: #000000;">            dropShadow.color = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">            dropShadow.alpha = <span style="color: #cc66cc;">0.8</span>;</span>
<span style="color: #000000;">            dropShadow.blurX = <span style="color: #cc66cc;">20</span>;</span>
<span style="color: #000000;">            dropShadow.blurY = <span style="color: #cc66cc;">20</span>;</span>
&nbsp;
<span style="color: #000000;">            dropShadow.drawShadow<span style="color: #66cc66;">&#40;</span>graphics, x, y, width, height<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 getDropShadowAngle<span style="color: #66cc66;">&#40;</span>distance:Number, direction:String<span style="color: #66cc66;">&#41;</span>:Number <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>direction == <span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return distance <span style="color: #7400FF;">&gt;</span></span>= 0 ? 135 : 225;
            } else if (direction == &quot;right&quot;) {
                return distance &gt;= 0 ? 45 : 315;
            } else { // direction == &quot;center&quot;
                return distance &gt;= 0 ? 90 : 270;
            }
        }
        ]]&gt;
    <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:Group</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- fill --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> id=<span style="color: #ff0000;">&quot;bgFill&quot;</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/local:SparkSkinForHalo</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">The default Spark skins for the MX/Halo controls/containers can be found in the Flex SDK at:<br/>
<em>%Flex SDK%</em>\frameworks\projects\sparkskins\src\mx\skins\spark\*.</p>
<p>You can also set the <code>borderSkin</code> style 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>?<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/28/removing-the-border-from-the-halo-tree-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_Tree_borderSkin_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;
        mx|Tree {
            /* borderSkin: ClassReference(null); */
            borderSkin: ClassReference(&quot;skins.CustomBorderSkin&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;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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 set the <code>borderSkin</code> style 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>?<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/28/removing-the-border-from-the-halo-tree-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_Tree_borderSkin_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: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 skins.CustomBorderSkin;</span>
&nbsp;
<span style="color: #000000;">            protected function btn_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                tree1.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderSkin&quot;</span>, CustomBorderSkin<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;Set Tree border skin&quot;</span></span>
<span style="color: #000000;">            click=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree1&quot;</span></span>
<span style="color: #000000;">            labelField=<span style="color: #ff0000;">&quot;@label&quot;</span></span>
<span style="color: #000000;">            showRoot=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;MailBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Mail&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;INBOX&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Personal Folder&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Business&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Demo&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Personal&quot;</span> isBranch=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;Pfolder label=<span style="color: #ff0000;">&quot;Saved Mail&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Sent&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;">&lt;folder label=<span style="color: #ff0000;">&quot;Trash&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;">&lt;/folder<span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Tree</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: 'Removing the border from the Halo Tree control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/',contentID: 'post-1759',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/08/28/removing-the-border-from-the-halo-tree-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting a control bar background image fill on a Halo Panel control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-control-in-flex-4/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 06:59:06 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[Panel]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1469</guid>
		<description><![CDATA[<p>The following example shows how you can set the control bar background image fill on a Halo Panel control (with default Spark skin) in Flex 4 by setting the borderSkin style.</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/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Panel_borderSkin_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;mx:Panel id=&#34;panel&#34; borderSkin=&#34;skins.CustomPanelBorderSkin&#34; width=&#34;80%&#34; height=&#34;80%&#34; horizontalCenter=&#34;0&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the control bar background image fill on a Halo Panel control (with default Spark skin) in Flex 4 by setting the <code>borderSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1469"></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/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-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_Panel_borderSkin_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;mx:Panel</span> id=<span style="color: #ff0000;">&quot;panel&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;skins.CustomPanelBorderSkin&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;80%&quot;</span> height=<span style="color: #ff0000;">&quot;80%&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list&quot;</span> labelField=<span style="color: #ff0000;">&quot;fontName&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:List</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;60&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span></span>
<span style="color: #000000;">                        text=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog&quot;</span></span>
<span style="color: #000000;">                        fontFamily=<span style="color: #ff0000;">&quot;{list.selectedItem.fontName}&quot;</span></span>
<span style="color: #000000;">                        fontSize=<span style="color: #ff0000;">&quot;32&quot;</span></span>
<span style="color: #000000;">                        maxDisplayedLines=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                        width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ControlBar</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Panel</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>And the custom skin class, skins/CustomPanelBorderSkin.mxml, is as follows:</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/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomPanelBorderSkin&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;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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.core.EdgeMetrics;</span>
<span style="color: #000000;">            import mx.core.IUIComponent;</span>
&nbsp;
<span style="color: #000000;">            /* Define the skin elements that should not be colorized. </span>
<span style="color: #000000;">               For panel, border and title backround are skinned, but the content area and title text are not. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return exclusions;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">            static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;bgFill&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return contentFill</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private var _metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var hasPanelParent:Boolean = isPanel<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var controlBar:IUIComponent = hasPanelParent ? Object<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.mx_internal::_controlBar : null;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>controlBar &amp;&amp; controlBar.includeInLayout<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    _metrics.bottom = controlBar.getExplicitOrMeasuredHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    _metrics.bottom = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                return _metrics;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return null;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return false;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var em:EdgeMetrics = borderMetrics;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>em.bottom <span style="color: #7400FF;">&gt;</span></span> 1) {
                    cbbg.height = em.bottom - 1;
                    cbdiv.bottom = cbbg.height;
                    cbbg.visible = cbdiv.visible = true;
                } else {
                    cbbg.visible = cbdiv.visible = false;
                }
                super.updateDisplayList(unscaledWidth, unscaledHeight);
            }
&nbsp;
            private static var panels:Object = {};
&nbsp;
            private static function isPanel(parent:Object):Boolean {
                var s:String = getQualifiedClassName(parent);
                if (panels[s] == 1) {
                    return true;
                }
                if (panels[s] == 0) {
                    return false;
                }
                if (s == &quot;mx.containers::Panel&quot;) {
                    panels[s] == 1;
                    return true;
                }
                var x:XML = describeType(parent);
                var xmllist:XMLList = x.extendsClass.(@type == &quot;mx.containers::Panel&quot;);
                if (xmllist.length() == 0) {
                    panels[s] = 0;
                    return false;
                }
                panels[s] = 1;
                return true;
            }
        ]]&gt;
    <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: #808080; font-style: italic;">&lt;!-- drop shadow --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:filters</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropShadowFilter</span> blurX=<span style="color: #ff0000;">&quot;20&quot;</span> blurY=<span style="color: #ff0000;">&quot;20&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.32&quot;</span> distance=<span style="color: #ff0000;">&quot;11&quot;</span> angle=<span style="color: #ff0000;">&quot;90&quot;</span> knockout=<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:filters</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 1: border --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> color=<span style="color: #ff0000;">&quot;0&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.50&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: background fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> id=<span style="color: #ff0000;">&quot;bgFill&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: title bar fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xE2E2E2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 4: title bar highlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xEAEAEA&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;31&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xC0C0C0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 5: control bar background --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbbg&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.6&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapFill</span> source=<span style="color: #ff0000;">&quot;@Embed('assets/pattern_149.gif')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 6: control bar divider line --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbdiv&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;20&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xCDCDCD&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</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>Or, you can set the <code>borderSkin</code> style globally 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/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-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_Panel_borderSkin_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 skins.CustomPanelBorderSkin;</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 panelStyles:CSSStyleDeclaration = StyleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.containers.Panel&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                panelStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderSkin&quot;</span>, CustomPanelBorderSkin<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;mx:Panel</span> id=<span style="color: #ff0000;">&quot;panel&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;skins.CustomPanelBorderSkin&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;80%&quot;</span> height=<span style="color: #ff0000;">&quot;80%&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;list&quot;</span> labelField=<span style="color: #ff0000;">&quot;fontName&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:List</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;60&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span></span>
<span style="color: #000000;">                        text=<span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog&quot;</span></span>
<span style="color: #000000;">                        fontFamily=<span style="color: #ff0000;">&quot;{list.selectedItem.fontName}&quot;</span></span>
<span style="color: #000000;">                        fontSize=<span style="color: #ff0000;">&quot;32&quot;</span></span>
<span style="color: #000000;">                        maxDisplayedLines=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                        width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ControlBar</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Panel</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: 'Setting a control bar background image fill on a Halo Panel control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-control-in-flex-4/',contentID: 'post-1469',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/07/08/setting-a-control-bar-background-image-fill-on-a-halo-panel-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting a title background image fill on a Halo Alert control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/07/setting-a-title-background-image-fill-on-a-halo-alert-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/07/setting-a-title-background-image-fill-on-a-halo-alert-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 06:59:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta1]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1466</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/">&#8220;Setting a background image fill on a Halo Alert control in Flex 4&#8243;</a>, we saw how you could can a repeating background image fill on a Halo Alert control (with default Spark skin) in Flex 4 by setting the borderSkin style.</p> <p>The following example shows how you can set the [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/">&#8220;Setting a background image fill on a Halo Alert control in Flex 4&#8243;</a>, we saw how you could can a repeating background image fill on a Halo Alert control (with default Spark skin) in Flex 4 by setting the <code>borderSkin</code> style.</p>
<p>The following example shows how you can set the title bar background image fill on a Halo Alert control (with default Spark skin) in Flex 4 by setting the <code>borderSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1466"></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/07/07/setting-a-title-background-image-fill-on-a-halo-alert-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_Alert_borderSkin_test3&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;
        mx|Alert {
            borderSkin: ClassReference(&quot;skins.CustomPanelBorderSkin&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;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;">            protected function btn_clickHandler<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var a: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;">                a.status = mx_internal::VERSION;</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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_clickHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</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>And the custom skin class, skins/CustomPanelBorderSkin.mxml, is as follows:</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/07/07/setting-a-title-background-image-fill-on-a-halo-alert-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomPanelBorderSkin&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;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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.core.EdgeMetrics;</span>
<span style="color: #000000;">            import mx.core.IUIComponent;</span>
&nbsp;
<span style="color: #000000;">            /* Define the skin elements that should not be colorized. </span>
<span style="color: #000000;">               For panel, border and title backround are skinned, but the content area and title text are not. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return exclusions;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">            static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;bgFill&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return contentFill</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private var _metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var hasPanelParent:Boolean = isPanel<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var controlBar:IUIComponent = hasPanelParent ? Object<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.mx_internal::_controlBar : null;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>controlBar &amp;&amp; controlBar.includeInLayout<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    _metrics.bottom = controlBar.getExplicitOrMeasuredHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    _metrics.bottom = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                return _metrics;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return null;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return false;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var em:EdgeMetrics = borderMetrics;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>em.bottom <span style="color: #7400FF;">&gt;</span></span> 1) {
                    cbbg.height = em.bottom - 1;
                    cbdiv.bottom = cbbg.height;
                    cbbg.visible = cbdiv.visible = true;
                } else {
                    cbbg.visible = cbdiv.visible = false;
                }
                super.updateDisplayList(unscaledWidth, unscaledHeight);
            }
&nbsp;
            private static var panels:Object = {};
&nbsp;
            private static function isPanel(parent:Object):Boolean {
                var s:String = getQualifiedClassName(parent);
                if (panels[s] == 1) {
                    return true;
                }
                if (panels[s] == 0) {
                    return false;
                }
                if (s == &quot;mx.containers::Panel&quot;) {
                    panels[s] == 1;
                    return true;
                }
                var x:XML = describeType(parent);
                var xmllist:XMLList = x.extendsClass.(@type == &quot;mx.containers::Panel&quot;);
                if (xmllist.length() == 0) {
                    panels[s] = 0;
                    return false;
                }
                panels[s] = 1;
                return true;
            }
        ]]&gt;
    <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: #808080; font-style: italic;">&lt;!-- drop shadow --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:filters</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropShadowFilter</span> blurX=<span style="color: #ff0000;">&quot;20&quot;</span> blurY=<span style="color: #ff0000;">&quot;20&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.32&quot;</span> distance=<span style="color: #ff0000;">&quot;11&quot;</span> angle=<span style="color: #ff0000;">&quot;90&quot;</span> knockout=<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:filters</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 1: border --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> color=<span style="color: #ff0000;">&quot;0&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.50&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: background fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> id=<span style="color: #ff0000;">&quot;bgFill&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: title bar fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.6&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapFill</span> source=<span style="color: #ff0000;">&quot;@Embed('assets/pattern_149.gif')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 4: title bar highlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xEAEAEA&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;31&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xC0C0C0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 5: control bar background --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbbg&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xE8E8E8&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 6: control bar divider line --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbdiv&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;20&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xCDCDCD&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you can also set the <code>borderSkin</code> style globally 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/07/07/setting-a-title-background-image-fill-on-a-halo-alert-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_Alert_borderSkin3_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.controls.Alert;</span>
<span style="color: #000000;">            import skins.CustomPanelBorderSkin;</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 alertStyles:CSSStyleDeclaration = 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;">                alertStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderSkin&quot;</span>, CustomPanelBorderSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function btn_clickHandler<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var a: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;">                a.status = mx_internal::VERSION;</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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_clickHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</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: 'Setting a title background image fill on a Halo Alert control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/07/setting-a-title-background-image-fill-on-a-halo-alert-control-in-flex-4/',contentID: 'post-1466',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/07/07/setting-a-title-background-image-fill-on-a-halo-alert-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing the default dropshadow from the Halo Alert control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/06/removing-the-default-dropshadow-from-the-halo-alert-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/06/removing-the-default-dropshadow-from-the-halo-alert-control-in-flex-4/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 06:59:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta1]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1463</guid>
		<description><![CDATA[<p>The following example shows how you can remove the default dropshadow from the Halo Alert control (with default Spark skins) in Flex 4 by setting the borderSkin style.</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/07/06/removing-the-default-dropshadow-from-the-halo-alert-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Alert_borderSkin_test2&#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; mx&#124;Alert [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can remove the default dropshadow from the Halo Alert control (with default Spark skins) in Flex 4 by setting the <code>borderSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1463"></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/07/06/removing-the-default-dropshadow-from-the-halo-alert-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_Alert_borderSkin_test2&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;
        mx|Alert {
            borderSkin: ClassReference(&quot;skins.CustomPanelBorderSkin&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;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;">            protected function btn_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Show Alert&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</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>And the custom border skin class, skins/CustomPanelBorderSkin.mxml, is as follows:</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/07/06/removing-the-default-dropshadow-from-the-halo-alert-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomPanelBorderSkin&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;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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.core.EdgeMetrics;</span>
<span style="color: #000000;">            import mx.core.IUIComponent;</span>
&nbsp;
<span style="color: #000000;">            /* Define the skin elements that should not be colorized. </span>
<span style="color: #000000;">               For panel, border and title backround are skinned, but the content area and title text are not. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return exclusions;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">            static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;bgFill&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return contentFill</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private var _metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var hasPanelParent:Boolean = isPanel<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var controlBar:IUIComponent = hasPanelParent ? Object<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.mx_internal::_controlBar : null;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>controlBar &amp;&amp; controlBar.includeInLayout<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    _metrics.bottom = controlBar.getExplicitOrMeasuredHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    _metrics.bottom = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                return _metrics;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return null;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return false;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var em:EdgeMetrics = borderMetrics;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>em.bottom <span style="color: #7400FF;">&gt;</span></span> 1) {
                    cbbg.height = em.bottom - 1;
                    cbdiv.bottom = cbbg.height;
                    cbbg.visible = cbdiv.visible = true;
                } else {
                    cbbg.visible = cbdiv.visible = false;
                }
                super.updateDisplayList(unscaledWidth, unscaledHeight);
            }
&nbsp;
            private static var panels:Object = {};
&nbsp;
            private static function isPanel(parent:Object):Boolean {
                var s:String = getQualifiedClassName(parent);
                if (panels[s] == 1) {
                    return true;
                }
                if (panels[s] == 0) {
                    return false;
                }
                if (s == &quot;mx.containers::Panel&quot;) {
                    panels[s] == 1;
                    return true;
                }
                var x:XML = describeType(parent);
                var xmllist:XMLList = x.extendsClass.(@type == &quot;mx.containers::Panel&quot;);
                if (xmllist.length() == 0) {
                    panels[s] = 0;
                    return false;
                }
                panels[s] = 1;
                return true;
            }
        ]]&gt;
    <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: #808080; font-style: italic;">&lt;!-- layer 1: border --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> color=<span style="color: #ff0000;">&quot;0&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.50&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: background fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> id=<span style="color: #ff0000;">&quot;bgFill&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: title bar fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xE2E2E2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 4: title bar highlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xEAEAEA&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;31&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xC0C0C0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 5: control bar background --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbbg&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xE8E8E8&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 6: control bar divider line --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbdiv&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;20&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xCDCDCD&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</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>Or, you could set the <code>borderSkin</code> style 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/07/06/removing-the-default-dropshadow-from-the-halo-alert-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_Alert_borderSkin_test2&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.controls.Alert;</span>
<span style="color: #000000;">            import skins.CustomPanelBorderSkin;</span>
&nbsp;
<span style="color: #000000;">            protected function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var alertStyles:CSSStyleDeclaration = 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;">                alertStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderSkin&quot;</span>, CustomPanelBorderSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function btn_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Show Alert&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</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: 'Removing the default dropshadow from the Halo Alert control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/06/removing-the-default-dropshadow-from-the-halo-alert-control-in-flex-4/',contentID: 'post-1463',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/07/06/removing-the-default-dropshadow-from-the-halo-alert-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting a background image fill on a Halo Alert control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 06:59:36 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta1]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[PanelBorderSkin]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1458</guid>
		<description><![CDATA[<p>The following example shows how you can set a repeating background image fill on a Halo Alert control (with default Spark skin) in Flex 4 by setting the borderSkin style.</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/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Alert_borderSkin_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;; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set a repeating background image fill on a Halo Alert control (with default Spark skin) in Flex 4 by setting the <code>borderSkin</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1458"></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/07/05/setting-a-background-image-fill-on-a-halo-alert-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_Alert_borderSkin_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;
        mx|Alert {
            borderSkin: ClassReference(&quot;skins.CustomPanelBorderSkin&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;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;">            protected function btn_clickHandler<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var a: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;">                a.status = mx_internal::VERSION;</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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_clickHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</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>And the custom skin class, skins/CustomPanelBorderSkin.mxml, is as follows:</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/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomPanelBorderSkin&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;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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.core.EdgeMetrics;</span>
<span style="color: #000000;">        import mx.core.IUIComponent;</span>
&nbsp;
<span style="color: #000000;">        /* Define the skin elements that should not be colorized. </span>
<span style="color: #000000;">           For panel, border and title backround are skinned, but the content area and title text are not. */</span>
<span style="color: #000000;">        static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return exclusions;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">        static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">        override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return contentFill</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span>;</span>
&nbsp;
<span style="color: #000000;">        private var _metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">        public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            var hasPanelParent:Boolean = isPanel<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            var controlBar:IUIComponent = hasPanelParent ? Object<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.mx_internal::_controlBar : null;</span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>controlBar &amp;&amp; controlBar.includeInLayout<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                _metrics.bottom = controlBar.getExplicitOrMeasuredHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                _metrics.bottom = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            return _metrics;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return null;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            return false;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">        override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            var em:EdgeMetrics = borderMetrics;</span>
<span style="color: #000000;">            if <span style="color: #66cc66;">&#40;</span>em.bottom <span style="color: #7400FF;">&gt;</span></span> 1) {
                cbbg.height = em.bottom - 1;
                cbdiv.bottom = cbbg.height;
                cbbg.visible = cbdiv.visible = true;
            } else {
                cbbg.visible = cbdiv.visible = false;
            }
            super.updateDisplayList(unscaledWidth, unscaledHeight);
        }
&nbsp;
        private static var panels:Object = {};
&nbsp;
        private static function isPanel(parent:Object):Boolean {
            var s:String = getQualifiedClassName(parent);
            if (panels[s] == 1) {
                return true;
            }
            if (panels[s] == 0) {
                return false;
            }
            if (s == &quot;mx.containers::Panel&quot;) {
                panels[s] == 1;
                return true;
            }
            var x:XML = describeType(parent);
            var xmllist:XMLList = x.extendsClass.(@type == &quot;mx.containers::Panel&quot;);
            if (xmllist.length() == 0) {
                panels[s] = 0;
                return false;
            }
            panels[s] = 1;
            return true;
        }
        ]]&gt;
    <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: #808080; font-style: italic;">&lt;!-- drop shadow --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:filters</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropShadowFilter</span> blurX=<span style="color: #ff0000;">&quot;20&quot;</span> blurY=<span style="color: #ff0000;">&quot;20&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.32&quot;</span> distance=<span style="color: #ff0000;">&quot;11&quot;</span> angle=<span style="color: #ff0000;">&quot;90&quot;</span> knockout=<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:filters</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 1: border --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> color=<span style="color: #ff0000;">&quot;0&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.50&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: background fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.6&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapFill</span> source=<span style="color: #ff0000;">&quot;@Embed('assets/pattern_158.gif')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: title bar fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xE2E2E2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 4: title bar highlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xEAEAEA&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
       <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;31&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xC0C0C0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 5: control bar background --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbbg&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xE8E8E8&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 6: control bar divider line --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;cbdiv&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;20&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xCDCDCD&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you can also set the <code>borderSkin</code> style globally 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/07/05/setting-a-background-image-fill-on-a-halo-alert-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_Alert_borderSkin_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.controls.Alert;</span>
<span style="color: #000000;">            import skins.CustomPanelBorderSkin;</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 alertStyles:CSSStyleDeclaration = 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;">                alertStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderSkin&quot;</span>, CustomPanelBorderSkin<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function btn_clickHandler<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var a: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;">                a.status = mx_internal::VERSION;</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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_clickHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</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: 'Setting a background image fill on a Halo Alert control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/',contentID: 'post-1458',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,Gumbo,PanelBorderSkin',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/07/05/setting-a-background-image-fill-on-a-halo-alert-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the background fill image on a Halo DataGrid in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/04/setting-the-background-fill-image-on-a-halo-datagrid-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/04/setting-the-background-fill-image-on-a-halo-datagrid-in-flex-4/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 06:59:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1427</guid>
		<description><![CDATA[<p>The following example shows how you can set the background fill image on a Halo DataGrid control (with default Spark skin) in Flex 4 by setting the borderSkin and alternatingItemColors styles.</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/07/04/setting-the-background-fill-image-on-a-halo-datagrid-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_DataGrid_borderSkin_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;mx:DataGrid id=&#34;dataGrid&#34; dataProvider=&#34;{Font.enumerateFonts(true)}&#34; borderSkin=&#34;skins.CustomBorderSkin&#34; alternatingItemColors=&#34;[]&#34; horizontalCenter=&#34;0&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background fill image on a Halo DataGrid control (with default Spark skin) in Flex 4 by setting the <code>borderSkin</code> and <code>alternatingItemColors</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-1427"></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/07/04/setting-the-background-fill-image-on-a-halo-datagrid-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_borderSkin_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;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span></span>
<span style="color: #000000;">            borderSkin=<span style="color: #ff0000;">&quot;skins.CustomBorderSkin&quot;</span></span>
<span style="color: #000000;">            alternatingItemColors=<span style="color: #ff0000;">&quot;[]&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>And the custom border skin class, skins/CustomBorderSkin.mxml, is as follows:</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/07/04/setting-the-background-fill-image-on-a-halo-datagrid-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;local:SparkSkinForHalo</span> name=<span style="color: #ff0000;">&quot;CustomBorderSkin&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:local=<span style="color: #ff0000;">&quot;mx.skins.spark.*&quot;</span></span>
<span style="color: #000000;">        implements=<span style="color: #ff0000;">&quot;mx.core.IRectangularBorder&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.core.EdgeMetrics;</span>
<span style="color: #000000;">            import mx.core.IUIComponent;</span>
<span style="color: #000000;">            import mx.graphics.RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">            /* Define the skin elements that should not be colorized. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span>return exclusions;<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            /* Define the content fill items that should be colored by the <span style="color: #ff0000;">&quot;contentBackgroundColor&quot;</span> style. */</span>
<span style="color: #000000;">            static private const contentFill:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override public function get contentItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span>return contentFill<span style="color: #66cc66;">&#125;</span>;</span>
&nbsp;
<span style="color: #000000;">            /* Define the border item. */</span>
<span style="color: #000000;">            static private const borderItem:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;borderStroke&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">            override protected function get borderItems<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span>return borderItem;<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">            override protected function get defaultBorderItemColor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:uint <span style="color: #66cc66;">&#123;</span>return 0x696969;<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            static private const metrics:EdgeMetrics = new EdgeMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">            private var dropShadow:RectangularDropShadow;</span>
&nbsp;
<span style="color: #000000;">            public function get borderMetrics<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:EdgeMetrics <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return metrics;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get backgroundImageBounds<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Rectangle <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return null;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function set backgroundImageBounds<span style="color: #66cc66;">&#40;</span>value:Rectangle<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function get hasBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return false;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            public function layoutBackgroundImage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                graphics.clear<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                super.updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>parent &amp;&amp; parent is IUIComponent &amp;&amp; !IUIComponent<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>.enabled<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    alpha = <span style="color: #cc66cc;">0.5</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    alpha = <span style="color: #cc66cc;">1.0</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                // Draw drop shadow, if needed</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowEnabled&quot;</span><span style="color: #66cc66;">&#41;</span> == false<span style="color: #66cc66;">&#41;</span> || </span>
<span style="color: #000000;">                        <span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowEnabled&quot;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #66cc66;">&#41;</span> ||</span>
<span style="color: #000000;">                        <span style="color: #66cc66;">&#40;</span>width == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> || <span style="color: #66cc66;">&#40;</span>height == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    return;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                // Create a RectangularDropShadow object, set its properties,</span>
<span style="color: #000000;">                // and draw the shadow</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!dropShadow<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    dropShadow = new RectangularDropShadow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                dropShadow.distance = <span style="color: #cc66cc;">5</span>;</span>
<span style="color: #000000;">                dropShadow.angle = <span style="color: #cc66cc;">90</span>;</span>
<span style="color: #000000;">                dropShadow.color = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                dropShadow.alpha = <span style="color: #cc66cc;">0.8</span>;</span>
<span style="color: #000000;">                dropShadow.blurX = <span style="color: #cc66cc;">20</span>;</span>
<span style="color: #000000;">                dropShadow.blurY = <span style="color: #cc66cc;">20</span>;</span>
&nbsp;
<span style="color: #000000;">                dropShadow.drawShadow<span style="color: #66cc66;">&#40;</span>graphics, x, y, width, height<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 getDropShadowAngle<span style="color: #66cc66;">&#40;</span>distance:Number, direction:String<span style="color: #66cc66;">&#41;</span>:Number <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>direction == <span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    return distance <span style="color: #7400FF;">&gt;</span></span>= 0 ? 135 : 225;
                } else if (direction == &quot;right&quot;) {
                    return distance &gt;= 0 ? 45 : 315;
                } else { // direction == &quot;center&quot; 
                    return distance &gt;= 0 ? 90 : 270;
                }
            }
        ]]&gt;
    <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:Group</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- border --&gt;</span></span> 
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> id=<span style="color: #ff0000;">&quot;borderStroke&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- fill --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.6&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapFill</span> source=<span style="color: #ff0000;">&quot;@Embed('assets/pattern_147.gif')&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/local:SparkSkinForHalo</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">The default Spark skins for the MX/Halo controls/containers can be found in the Flex SDK at:<br/>
<em>%Flex SDK%</em>\frameworks\projects\sparkskins\src\mx\skins\spark\*.</p>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_DataGrid_borderSkin_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_DataGrid_borderSkin_test/bin/main.html" width="100%" height="300"></iframe></p>
<p class="alert">Background image pattern copyright of <a href="http://squidfingers.com/patterns/">Squidfingers.com</a>.</p><br />
<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 also set the <code>borderSkin</code> style 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/07/04/setting-the-background-fill-image-on-a-halo-datagrid-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_borderSkin_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;
        mx|DataGrid {
            alternatingItemColors: ClassReference(null);
            borderSkin: ClassReference(&quot;skins.CustomBorderSkin&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;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&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>Or, you can set the <code>borderSkin</code> style 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/07/04/setting-the-background-fill-image-on-a-halo-datagrid-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_borderSkin_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: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 skins.CustomBorderSkin;</span>
&nbsp;
<span style="color: #000000;">            protected function btn_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                dataGrid.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderSkin&quot;</span>, CustomBorderSkin<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;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Set border skin&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <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;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span></span>
<span style="color: #000000;">            alternatingItemColors=<span style="color: #ff0000;">&quot;[]&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: 'Setting the background fill image on a Halo DataGrid in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/04/setting-the-background-fill-image-on-a-halo-datagrid-in-flex-4/',contentID: 'post-1427',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/07/04/setting-the-background-fill-image-on-a-halo-datagrid-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting the corner radius on the Halo Alert control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/06/20/setting-the-corner-radius-on-the-halo-alert-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/06/20/setting-the-corner-radius-on-the-halo-alert-control-in-flex-4/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 06:59:38 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta1]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[cornerRadius]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/20/setting-the-corner-radius-on-the-halo-control-in-flex-4/</guid>
		<description><![CDATA[<p>The following example shows how you can set the corner radius on the Halo TextArea control (with default Spark skin) in Flex 4 by creating a custom skin and setting the radiusX and radiusY properties on the Rect objects (in Flex 3 and earlier this was done by setting the cornerRadius style directly).</p> <p>Full code [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the corner radius on the Halo TextArea control (with default Spark skin) in Flex 4 by creating a custom skin and setting the <code>radiusX</code> and <code>radiusY</code> properties on the Rect objects (in Flex 3 and earlier this was done by setting the <code>cornerRadius</code> style directly).</p>
<p>Full code after the jump.</p>
<p><span id="more-1142"></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>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/20/setting-the-corner-radius-on-the-halo-control-in-flex-4/ --&gt;
&lt;s:Application name="Alert_SparkSkin_cornerRadius_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        xmlns:s="library://ns.adobe.com/flex/spark"&gt;

    &lt;fx:Style&gt;
        @namespace mx "library://ns.adobe.com/flex/halo";

        mx|Alert {
            borderSkin: ClassReference("skins.CustomAlertSkin");
        }
    &lt;/fx:Style&gt;

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

    &lt;s:Button id="btn"
            label="show Alert"
            click="Alert.show('The quick brown fox jumps over the lazy dog.', 'Alert title');"
            horizontalCenter="0"
            verticalCenter="0" /&gt;

&lt;/s:Application&gt;
</pre>
<p>And the custom Alert skin class is as follows:</p>
<p class="download"><a href="">View skins/CustomAlertSkin.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/20/setting-the-corner-radius-on-the-halo-control-in-flex-4/ --&gt;
&lt;s:SparkSkin name="CustomAlertSkin"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        implements="mx.core.IRectangularBorder"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
        import mx.core.EdgeMetrics;
        import mx.core.IUIComponent;

        /* Define the skin elements that should not be colorized.
           For panel, border and title backround are skinned, but the content area and title text are not. */
        static private const exclusions:Array = ["background"];
        override public function get colorizeExclusions():Array {return exclusions;}

        /* Define the content fill items that should be colored by the "contentBackgroundColor" style. */
        static private const contentFill:Array = ["bgFill"];
        override public function get contentItems():Array {return contentFill};

        private var _metrics:EdgeMetrics = new EdgeMetrics(1, 32, 1, 1);
        public function get borderMetrics():EdgeMetrics {
            var hasPanelParent:Boolean = isPanel(parent);
            var controlBar:IUIComponent = hasPanelParent ? Object(parent).mx_internal::_controlBar : null;

            if (controlBar &#038;&#038; controlBar.includeInLayout) {
                _metrics.bottom = controlBar.getExplicitOrMeasuredHeight() + 1;
            } else {
                _metrics.bottom = 1;
            }
            return _metrics;
        }

        public function get backgroundImageBounds():Rectangle {
            return null;
        }

        public function set backgroundImageBounds(value:Rectangle):void {
        }

        public function get hasBackgroundImage():Boolean {
            return false;
        }

        public function layoutBackgroundImage():void {
        }

        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
            var em:EdgeMetrics = borderMetrics;

            if (em.bottom &gt; 1) {
                cbbg.height = em.bottom - 1;
                cbdiv.bottom = cbbg.height;
                cbbg.visible = cbdiv.visible = true;
            } else {
                cbbg.visible = cbdiv.visible = false;
            }
            super.updateDisplayList(unscaledWidth, unscaledHeight);
        }

        private static var panels:Object = {};

        private static function isPanel(parent:Object):Boolean {
            var s:String = getQualifiedClassName(parent);
            if (panels[s] == 1) {
                return true;
            }
            if (panels[s] == 0) {
                return false;
            }
            if (s == "mx.containers::Panel") {
                panels[s] == 1;
                return true;
            }

            var x:XML = describeType(parent);
            var xmllist:XMLList = x.extendsClass.(@type == "mx.containers::Panel");
            if (xmllist.length() == 0) {
                panels[s] = 0;
                return false;
            }
            panels[s] = 1;
            return true;
        }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;fx:Declarations&gt;
        &lt;fx:Number id="rad"&gt;10&lt;/fx:Number&gt;
    &lt;/fx:Declarations&gt;

    &lt;!-- drop shadow --&gt;
    &lt;s:Rect left="0" top="0" right="0" bottom="0" radiusX="{rad}" radiusY="{rad}"&gt;
        &lt;s:filters&gt;
            &lt;s:DropShadowFilter blurX="20" blurY="20" alpha="0.32" distance="11" angle="90" knockout="true" /&gt;
        &lt;/s:filters&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor color="0" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

    &lt;!-- layer 1: border --&gt;
    &lt;s:Rect left="0" right="0" top="0" bottom="0" radiusX="{rad}" radiusY="{rad}"&gt;
        &lt;s:stroke&gt;
            &lt;s:SolidColorStroke color="0" alpha="0.50" weight="1" /&gt;
        &lt;/s:stroke&gt;
    &lt;/s:Rect&gt;

    &lt;!-- layer 2: background fill --&gt;
    &lt;s:Rect id="background" left="1" top="1" right="1" bottom="1" radiusX="{rad}" radiusY="{rad}"&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor color="0xFFFFFF" id="bgFill" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

    &lt;!-- layer 5: control bar background --&gt;
    &lt;s:Rect id="cbbg" left="1" right="1" bottom="1" height="20" radiusX="{rad}" radiusY="{rad}"&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor color="0xE8E8E8" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

    &lt;!-- layer 6: control bar divider line --&gt;
    &lt;s:Rect id="cbdiv" left="1" right="1" bottom="20" height="1"&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor color="0xCDCDCD" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

&lt;/s:SparkSkin&gt;
</pre>
<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: 'Setting the corner radius on the Halo Alert control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/06/20/setting-the-corner-radius-on-the-halo-alert-control-in-flex-4/',contentID: 'post-1142',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin,cornerRadius,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/06/20/setting-the-corner-radius-on-the-halo-alert-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Changing the background alpha on the Halo TextArea control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 06:59:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/</guid>
		<description><![CDATA[<p>The following example shows how you can set the background alpha on the Halo TextArea control&#8217;s Spark skin in Flex 4 by setting the borderSkin style. As you may have noticed, the Halo components have new &#8220;Spark&#8221; themed skins in Flex 4 (basically so you can use Halo+Spark components in the same Flex project and [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background alpha on the Halo TextArea control&#8217;s Spark skin in Flex 4 by setting the <code>borderSkin</code> style. As you may have noticed, the Halo components have new &#8220;Spark&#8221; themed skins in Flex 4 (basically so you can use Halo+Spark components in the same Flex project and have a consistent look-and-feel). You may also have noticed that several styles on the Halo controls don&#8217;t appear to work any more when using the Spark skins. For example, if you want to change the background fill alpha on the Halo TextArea control in Flex 4, you can no longer set the <code>backgroundAlpha</code> style, you&#8217;ll now need to create a custom skin and set the <code>borderSkin</code> style.</p>
<p>The various Halo component&#8217;s new Spark skins can be found in your Flex 4 SDK installation in the following location: &lt;Flex SDK&gt;\frameworks\projects\sparkskins\src\mx\skins\spark\&#8230;</p>
<p class="note">If you want to set the border skin on the Halo TextArea control, you&#8217;ll need to copy the TextInputBorderSkin.mxml file.</p>
<p>Full code after the jump.</p>
<p><span id="more-1105"></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>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_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/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"&gt;

    &lt;mx:TextArea id="textArea"
            borderSkin="skins.CustomHaloTextAreaBorderSkin"
            left="50" right="50"
            top="50" bottom="50"&gt;
        &lt;mx:htmlText&gt;&lt;fx:String source="lorem.html" /&gt;&lt;/mx:htmlText&gt;
    &lt;/mx:TextArea&gt;

&lt;/s:Application&gt;
</pre>
<p>And the custom skin class, CustomHaloTextAreaBorderSkin.mxml, is as follows:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/source/skins/CustomHaloTextAreaBorderSkin.mxml.html">View skins/CustomHaloTextAreaBorderSkin.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;local:SparkSkinForHalo name="CustomHaloTextAreaBorderSkin"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:local="mx.skins.spark.*"
        implements="mx.core.IBorder"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import mx.core.EdgeMetrics;
            import mx.core.IUIComponent;

            /* Define the skin elements that should not be colorized. */
            static private const exclusions:Array = ["background"];
            override public function get colorizeExclusions():Array {return exclusions;}

            /* Define the content fill items that should be colored by the "contentBackgroundColor" style. */
            static private const contentFill:Array = ["bgFill"];
            override public function get contentItems():Array {return contentFill};

            /* Define the border items.*/
            static private const borderItem:Array = ["borderEntry1", "borderEntry2"];
            override protected function get borderItems():Array {return borderItem;}

            static private const metrics:EdgeMetrics = new EdgeMetrics(2, 2, 2, 2);

            public function get borderMetrics():EdgeMetrics {
                return metrics;
            }

            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                super.updateDisplayList(unscaledWidth, unscaledHeight);

                if (parent &#038;&#038; (parent is IUIComponent) &#038;&#038; !IUIComponent(parent).enabled) {
                    alpha = 0.5;
                } else {
                    alpha = 1;
                }
            }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;!-- border --&gt;
    &lt;s:Rect left="0" right="0" top="0" bottom="0"&gt;
        &lt;s:stroke&gt;
            &lt;s:LinearGradientStroke rotation="90" weight="1"&gt;
                &lt;s:GradientEntry id="borderEntry1" alpha="0.5525" /&gt;
                &lt;s:GradientEntry id="borderEntry2" alpha="0.6375" /&gt;
            &lt;/s:LinearGradientStroke&gt;
        &lt;/s:stroke&gt;
    &lt;/s:Rect&gt;

    &lt;!-- fill --&gt;
    &lt;s:Rect id="background" left="1" right="1" top="1" bottom="1"&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor id="bgFill" color="0xFFFFFF" alpha="0.4" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

    &lt;!-- shadow --&gt;
    &lt;s:Rect left="1" top="1" right="1" height="1"&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor color="0x000000" alpha="0.12" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

&lt;/local:SparkSkinForHalo&gt;
</pre>
<p class="alert">The default Spark skins for the MX/Halo controls/containers can be found in the Flex SDK at:<br/>
<em>%Flex SDK%</em>\frameworks\projects\sparkskins\src\mx\skins\spark\*.</p>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/main.html" width="100%" height="400"></iframe></p>
<p>You can also set the <code>borderSkin</code> style in an external .CSS file or &lt;Style/&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"&gt;

    &lt;fx:Style&gt;
        @namespace mx "library://ns.adobe.com/flex/halo";

        mx|TextArea {
            borderSkin: ClassReference("skins.CustomHaloTextAreaBorderSkin");
            left: 50;
            right: 50;
            top: 50;
            bottom: 50;
        }
    &lt;/fx:Style&gt;

    &lt;mx:TextArea id="textArea"&gt;
        &lt;mx:htmlText&gt;&lt;fx:String source="lorem.html" /&gt;&lt;/mx:htmlText&gt;
    &lt;/mx:TextArea&gt;

&lt;/s:Application&gt;
</pre>
<p>Or you can set the <code>borderSkin</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import skins.CustomHaloTextAreaBorderSkin;

            private function btn_click(evt:MouseEvent):void {
                textArea.setStyle("borderSkin", CustomHaloTextAreaBorderSkin);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;s:Button id="btn"
            label="Set border skin"
            click="btn_click(event);"
            left="10"
            top="10" /&gt;

    &lt;mx:TextArea id="textArea"
            left="50" right="50"
            top="50" bottom="50"&gt;
        &lt;mx:htmlText&gt;&lt;fx:String source="lorem.html" /&gt;&lt;/mx:htmlText&gt;
    &lt;/mx:TextArea&gt;

&lt;/s:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/source/main5.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"
        initialize="init();"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import mx.controls.TextArea;
            import skins.CustomHaloTextAreaBorderSkin;

            [Embed(source="lorem.html", mimeType="application/octet-stream")]
            private const lorem:Class;

            private var textArea:TextArea;

            private function init():void {
                textArea = new TextArea();
                textArea.htmlText = new lorem();
                textArea.left = 50;
                textArea.right = 50;
                textArea.top = 50;
                textArea.bottom = 50;
                textArea.setStyle("borderSkin", CustomHaloTextAreaBorderSkin);
                addElement(textArea);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

&lt;/s:Application&gt;
</pre>
<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: 'Changing the background alpha on the Halo TextArea control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/',contentID: 'post-1105',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha,borderSkin,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Removing the border skin on a List control in Flex</title>
		<link>http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 07:58:37 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[List]]></category>
		<category><![CDATA[borderSkin]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can remove the border skin on a Flex List control by setting the borderSkin style to null using MXML, CSS, and ActionScript.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/ --&#62; &#60;mx:Application name="List_borderSkin_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:List id="list" dataProvider="[Red,Orange,Yellow,Green,Blue]" borderSkin="{null}" width="100" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can remove the border skin on a Flex List control by setting the <code>borderSkin</code> style to <code>null</code> using MXML, CSS, and ActionScript.</p>
<p>Full code after the jump.</p>
<p><span id="more-951"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/ --&gt;
&lt;mx:Application name="List_borderSkin_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:List id="list"
            dataProvider="[Red,Orange,Yellow,Green,Blue]"
            borderSkin="{null}"
            width="100" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>You can also set the <code>borderSkin</code> style in an external .CSS file or &lt;Style&gt; block, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/ --&gt;
&lt;mx:Application name="List_borderSkin_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        List {
            borderSkin: ClassReference(null);
        }
    &lt;/mx:Style&gt;

    &lt;mx:List id="list"
            dataProvider="[Red,Orange,Yellow,Green,Blue]"
            width="100" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>borderSkin</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/ --&gt;
&lt;mx:Application name="List_borderSkin_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                list.setStyle("borderSkin", null);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:List id="list"
            dataProvider="[Red,Orange,Yellow,Green,Blue]"
            width="100"
            initialize="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Removing the border skin on a List control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/02/02/removing-the-border-skin-on-a-list-control-in-flex/',contentID: 'post-951',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderSkin',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/02/02/removing-the-border-skin-on-a-list-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

