<?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; Alert</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/alert/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting the accent color on the MX Alert control default button in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/11/12/setting-the-accent-color-on-the-mx-alert-control-default-button-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/11/12/setting-the-accent-color-on-the-mx-alert-control-default-button-in-flex-4/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 05:36:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[accentColor]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2188</guid>
		<description><![CDATA[<p>The following example shows how you can set the accent color on the MX Alert control&#8217;s default button in Flex 4 by setting the new accentColor 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/11/12/setting-the-accent-color-on-the-mx-alert-control-default-button-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Alert_accentColor_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; creationComplete=&#34;init();&#34;&#62; &#60;s:controlBarContent&#62; &#60;s:Button id=&#34;btn&#34; label=&#34;Show alert&#34; click=&#34;init();&#34; /&#62; &#60;/s:controlBarContent&#62; &#160; &#60;fx:Style&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the accent color on the MX Alert control&#8217;s default button in Flex 4 by setting the new <code>accentColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-2188"></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/11/12/setting-the-accent-color-on-the-mx-alert-control-default-button-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_accentColor_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;">        creationComplete=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s: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;init();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx: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 {
            accentColor: red;
        }
    <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 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;">                Alert.show<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Mauris sem nisl, feugiat at fermentum eget, lacinia et nisi. Aenean vitae elit purus, et placerat quam. In justo odio, euismod vel vestibulum ac, tincidunt sit amet lectus. Aliquam non est felis, at lacinia metus. Sed odio magna, adipiscing auctor elementum eu, tempus vitae tellus. Suspendisse varius felis ac ligula pellentesque egestas lobortis mauris hendrerit. Duis vulputate, leo vel lobortis aliquet, dui nunc scelerisque lacus, at convallis ipsum enim et ipsum. Aenean id posuere felis. Nullam bibendum sapien nec dui vehicula ullamcorper. Curabitur placerat auctor erat eget tristique. &quot;</span>, <span style="color: #ff0000;">&quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit&quot;</span>, Alert.YES|Alert.NO|Alert.OK|Alert.CANCEL<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the accent color on the MX Alert control default button in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/11/12/setting-the-accent-color-on-the-mx-alert-control-default-button-in-flex-4/',contentID: 'post-2188',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'accentColor,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/11/12/setting-the-accent-color-on-the-mx-alert-control-default-button-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Styling the emphasized button on an MX Alert control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 07:16:08 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[emphasizedSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1909</guid>
		<description><![CDATA[<p>The following example shows how you can style the emphasized button on a Halo/MX Alert control in Flex 4 by setting the buttonStyleName and emphasizedSkin styles.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_Alert_buttonStyleName_emphasizedSkin_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; &#60;s:controlBarContent&#62; &#60;s:Button id=&#34;btn&#34; label=&#34;Show Alert&#34; click=&#34;btn_click(event);&#34; /&#62; &#60;/s:controlBarContent&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace mx &#34;library://ns.adobe.com/flex/halo&#34;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can style the emphasized button on a Halo/MX Alert control in Flex 4 by setting the <code>buttonStyleName</code> and <code>emphasizedSkin</code> styles.</p>
<p><span id="more-1909"></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/09/25/styling-the-emphasized-button-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_buttonStyleName_emphasizedSkin_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>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> 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;/s:controlBarContent</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 {
            buttonStyleName: alertBtnStyles;
        }
&nbsp;
        .alertBtnStyles {
            emphasizedSkin: ClassReference(&quot;skins.CustomDefaultButtonSkin&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;Alert text&quot;</span>, <span style="color: #ff0000;">&quot;Alert title&quot;</span>, Alert.YES|Alert.NO<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>And the custom skin, <em>skins/CustomDefaultButtonSkin.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/09/25/styling-the-emphasized-button-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;CustomDefaultButtonSkin&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;">        minWidth=<span style="color: #ff0000;">&quot;21&quot;</span> minHeight=<span style="color: #ff0000;">&quot;19&quot;</span></span>
<span style="color: #000000;">        alpha.disabled=<span style="color: #ff0000;">&quot;0.5&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- states --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:states</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;up&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;over&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;overStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;down&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;downStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;disabled&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;disabledStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;selectedUp&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;selectedStates, selectedUpStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;selectedOver&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;overStates, selectedStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;selectedDown&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;downStates, selectedStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;selectedDisabled&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;selectedUpStates, disabledStates, selectedStates&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:states</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;">            <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;">2</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 cr:Number = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;cornerRadius&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>cornerRadius != cr<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    cornerRadius = cr;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                super.updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<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: #808080; font-style: italic;">&lt;!-- layer 1: shadow --&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> bottom=<span style="color: #ff0000;">&quot;-1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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;0x000000&quot;</span></span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.01&quot;</span></span>
<span style="color: #000000;">                        alpha.downStates=<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:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span></span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.07&quot;</span></span>
<span style="color: #000000;">                        alpha.downStates=<span style="color: #ff0000;">&quot;0.5&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 2: 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> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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;#FF0000&quot;</span></span>
<span style="color: #000000;">                        color.selectedUpStates=<span style="color: #ff0000;">&quot;#FF0000&quot;</span></span>
<span style="color: #000000;">                        color.overStates=<span style="color: #ff0000;">&quot;#FF0000&quot;</span></span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;#FF0000&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.85&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedOver=<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;#990000&quot;</span></span>
<span style="color: #000000;">                        color.selectedUpStates=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        color.over=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        color.selectedOver=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        color.downStates=<span style="color: #ff0000;">&quot;#990000&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.85&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedOver=<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: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 3: fill lowlight --&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> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;9&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.0099&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.0627&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: fill 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;9&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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></span>
<span style="color: #000000;">                    alpha=<span style="color: #ff0000;">&quot;0.33&quot;</span></span>
<span style="color: #000000;">                    alpha.selectedUpStates=<span style="color: #ff0000;">&quot;0.22&quot;</span></span>
<span style="color: #000000;">                    alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span></span>
<span style="color: #000000;">                    alpha.downStates=<span style="color: #ff0000;">&quot;0.12&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: highlight stroke (all states except down) --&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> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&quot;</span> excludeFrom=<span style="color: #ff0000;">&quot;downStates&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;#FF0000&quot;</span> alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span> alpha.selectedUpStates=<span style="color: #ff0000;">&quot;0.33&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;#990000&quot;</span> alpha.overStates=<span style="color: #ff0000;">&quot;0.22&quot;</span> alpha.selectedUpStates=<span style="color: #ff0000;">&quot;0.33&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>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 6: highlight stroke (down state only) --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<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> width=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, selectedOver&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.07&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:Rect</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> width=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, selectedOver&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.07&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:Rect</span> left=<span style="color: #ff0000;">&quot;2&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;2&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, selectedOver&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.25&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:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;2&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            includeIn=<span style="color: #ff0000;">&quot;downStates, selectedUpStates, selectedOver&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.09&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 7: border - put on top of the fill so it doesn't disappear when scale is less than 1 --&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> width=<span style="color: #ff0000;">&quot;69&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{cornerRadius}&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;0x000000&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.5625&quot;</span></span>
<span style="color: #000000;">                        alpha.down=<span style="color: #ff0000;">&quot;0.6375&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedStates=<span style="color: #ff0000;">&quot;0.6375&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;0x000000&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.75&quot;</span></span>
<span style="color: #000000;">                        alpha.down=<span style="color: #ff0000;">&quot;0.85&quot;</span></span>
<span style="color: #000000;">                        alpha.selectedStates=<span style="color: #ff0000;">&quot;0.85&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>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</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>
<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Halo_Alert_buttonStyleName_emphasizedSkin_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Halo_Alert_buttonStyleName_emphasizedSkin_test/main.html" width="100%" height="200"></iframe></p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the emphasized button on an MX Alert control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/',contentID: 'post-1909',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'buttonStyleName,emphasizedSkin,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/09/25/styling-the-emphasized-button-on-a-halo-alert-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</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 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>Creating a self-closing Alert control in Flex</title>
		<link>http://blog.flexexamples.com/2009/04/08/creating-a-self-closing-alert-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/04/08/creating-a-self-closing-alert-control-in-flex/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 04:39:02 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[PopUpManager]]></category>
		<category><![CDATA[Timer]]></category>
		<category><![CDATA[removePopUp()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/04/08/creating-a-self-closing-alert-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can create a self-closing Flex Alert control by creating a timer and using the static PopUpManager.removePopUp() method to remove the Alert after a certain time period.</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/04/08/creating-a-self-closing-alert-control-in-flex/ --&#62; &#60;mx:Application name="Alert_PopUpManager_removePopUp_test" xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="white" initialize="init();"&#62; &#60;mx:Script&#62; &#60;![CDATA[ [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a self-closing Flex Alert control by creating a timer and using the static <code>PopUpManager.removePopUp()</code> method to remove the Alert after a certain time period.</p>
<p>Full code after the jump.</p>
<p><span id="more-1042"></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/04/08/creating-a-self-closing-alert-control-in-flex/ --&gt;
&lt;mx:Application name="Alert_PopUpManager_removePopUp_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.Alert;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;

            private var alrt:Alert;
            private var alrtTimer:Timer;

            private function init():void {
                alrtTimer = new Timer(5000, 1);
                alrtTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeAlert);
            }

            private function showAlert():void {
                alrt = Alert.show("I'm an Alert control and I will close in 5 seconds unless closed by a user.", "Self closing Alert", Alert.OK, this, alrt_close);
                alrtTimer.reset();
                alrtTimer.start();
            }

            private function alrt_close(evt:CloseEvent):void {
                alrtTimer.stop();
                lbl.text = "Closed by user.";
            }

            private function removeAlert(evt:TimerEvent):void {
                PopUpManager.removePopUp(alrt);
                lbl.text = "Removed by application.";
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button label="Show Alert" click="showAlert();" /&gt;
    &lt;mx:Label id="lbl" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a self-closing Alert control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/04/08/creating-a-self-closing-alert-control-in-flex/',contentID: 'post-1042',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'removePopUp()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/04/08/creating-a-self-closing-alert-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Styling Alert controls in Flex using the StyleManager class and setStyle() method (Flex 4 Edition)</title>
		<link>http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/</link>
		<comments>http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 06:59:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[CSSStyleDeclaration]]></category>
		<category><![CDATA[StyleManager]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[setStyle()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/">&#8220;Styling Alert controls in Flex using the StyleManager class and setStyle() methods&#8221;</a>, we saw how to style a Flex Alert control using the static StyleManager.getStyleDeclaration() method, and the setStyle() method.</p> <p>The following example shows how you can do the same thing using the beta Flex 4 SDK by passing a [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/29/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-methods/">&#8220;Styling Alert controls in Flex using the StyleManager class and setStyle() methods&#8221;</a>, we saw how to style a Flex Alert control using the static <code>StyleManager.getStyleDeclaration()</code> method, and the <code>setStyle()</code> method.</p>
<p>The following example shows how you can do the same thing using the beta Flex 4 SDK by passing a fully qualified class name to the static <code>getStyleDeclaration()</code> method.</p>
<p><span id="more-1040"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_Alert_chromeColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #000000;">            private var alert:Alert;</span>
<span style="color: #000000;">            private var alertCSS:CSSStyleDeclaration;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                alertCSS = styleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.Alert&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function showAlert<span style="color: #66cc66;">&#40;</span>color:Object<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                alertCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;modalTransparencyColor&quot;</span>, color<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                alertCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;chromeColor&quot;</span>, color<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                alert = Alert.show<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;The quick brown fox jumps over the lazy dog.&quot;</span>, <span style="color: #ff0000;">&quot;Alert title&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Red&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;red&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('red');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Orange&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;haloOrange&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('haloOrange');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Yellow&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;yellow&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('yellow');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Green&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;haloGreen&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('haloGreen');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Blue&quot;</span></span>
<span style="color: #000000;">                  chromeColor=<span style="color: #ff0000;">&quot;haloBlue&quot;</span></span>
<span style="color: #000000;">                  click=<span style="color: #ff0000;">&quot;showAlert('haloBlue');&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_Alert_chromeColor_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_Alert_chromeColor_test/main.html" width="100%" height="300"></iframe></p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling Alert controls in Flex using the StyleManager class and setStyle() method (Flex 4 Edition) on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/',contentID: 'post-1040',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'getStyleDeclaration(),Gumbo,setStyle()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/04/06/styling-alert-controls-in-flex-using-the-stylemanager-class-and-setstyle-method-spark-edition/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Disabling an Alert control in Flex</title>
		<link>http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 06:56:47 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[enabled]]></category>
		<category><![CDATA[setTimeout()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can disable an Alert control for a specified number of milliseconds before the user can dismiss the dialog by setting the enabled property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_enabled_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/ --&#62; &#60;mx:Application name=&#34;Alert_enabled_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.controls.Alert; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can disable an Alert control for a specified number of milliseconds before the user can dismiss the dialog by setting the <code>enabled</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-834"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_enabled_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/ --&gt;
&lt;mx:Application name=&quot;Alert_enabled_test&quot;
        xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

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

            private const ENABLE_DELAY:uint = 3000; // 3 seconds

            private var a:Alert;

            private function showAlert():void {
                a = Alert.show(&quot;You have been logged out.&quot;, &quot;Goodbye&quot;);
                a.enabled = false;
                setTimeout(enableAlert, ENABLE_DELAY, a);
            }

            private function enableAlert(target:Alert):void {
                target.enabled = true;
                // PopUpManager.removePopUp(target);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button id=&quot;button&quot;
            label=&quot;Logout&quot;
            click=&quot;showAlert();&quot; /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_enabled_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Alert_enabled_test/bin/main.html" width="100%" height="200"></iframe></p>
<p class="new">Update (10/18/2007): If you don&#8217;t want to disable the entire Alert control, you can loop over the internal button array and disable each of the button controls individually, as seen in the following example:</p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/ --&gt;
&lt;mx:Application name=&quot;Alert_enabled_test&quot;
        xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.FlexEvent;
            import mx.utils.ObjectUtil;
            import mx.controls.Alert;
            import mx.managers.PopUpManager;

            private const ENABLE_DELAY:uint = 3000; // 3 seconds

            private var a:Alert;

            private function showAlert():void {
                a = Alert.show(&quot;You have been logged out.&quot;, &quot;Goodbye&quot;);
                toggleButtons(a, false);
                setTimeout(enableAlert, ENABLE_DELAY, a);
            }

            private function enableAlert(target:Alert):void {
                toggleButtons(target, true);
            }

            private function toggleButtons(target:Alert, isEnabled:Boolean):void {
                var buttonArr:Array = target.mx_internal::alertForm.mx_internal::buttons;
                var btn:Button;
                for each (btn in buttonArr) {
                    btn.enabled = isEnabled;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button id=&quot;button&quot;
            label=&quot;Logout&quot;
            click=&quot;showAlert();&quot; /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="alert">Since this example uses the <strong>mx_internal</strong> namespace, you can&#8217;t always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Disabling an Alert control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/',contentID: 'post-834',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'enabled,setTimeout()',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/10/17/disabling-an-alert-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating a custom creation complete effect on a Flex Alert control (redux)</title>
		<link>http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/</link>
		<comments>http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 04:12:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fade]]></category>
		<category><![CDATA[Move]]></category>
		<category><![CDATA[Parallel]]></category>
		<category><![CDATA[creationCompleteEffect]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/10/12/creating-a-custom-creation-complete-effect-on-a-flex-alert-control/">&#8220;Creating a custom creation complete effect on a Flex Alert control&#8221;</a>, we saw how you could specify an effect which gets played when an Alert control is displayed by setting the Alert control&#8217;s creationCompleteEffect style.</p> <p>The following example shows how you can apply a parallel Fade/Move effect when the Alert [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/10/12/creating-a-custom-creation-complete-effect-on-a-flex-alert-control/">&#8220;Creating a custom creation complete effect on a Flex Alert control&#8221;</a>, we saw how you could specify an effect which gets played when an Alert control is displayed by setting the Alert control&#8217;s <code>creationCompleteEffect</code> style.</p>
<p>The following example shows how you can apply a parallel Fade/Move effect when the Alert control is created by setting the the <code>creationCompleteEffect</code> effect/style in MXML and ActionScript.</p>
<p>Full code after the jump.</p>
<p><span id="more-799"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/ --&gt;
&lt;mx:Application name="Alert_creationCompleteEffect_test_3"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

            private function showAlert():void {
                var a:Alert = Alert.show("Nam vel nunc sed arcu fringilla fringilla. Cras dapibus nunc ut nisi.\\n" +
                        "Nullam porttitor mi et mauris.\\n" +
                        "Suspendisse hendrerit, turpis eu ornare suscipit, nulla sem tempus lorem,\\n" +
                        "sit amet semper nibh mi cursus neque.\\n" +
                        "Nulla vel purus. Sed a nulla. Quisque venenatis laoreet mi.",
                        "Lorem ipsum dolor sit amet, consectetuer adipiscing elit");
                a.isPopUp = false;
                a.cacheAsBitmap = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

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

        @font-face {
            src: local("Verdana");
            fontFamily: VerdanaEmbedded;
            fontWeight: bold;
        }

        Alert {
            fontFamily: VerdanaEmbedded;
            creationCompleteEffect: alertCreationCompleteEffect;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Parallel id="alertCreationCompleteEffect"&gt;
        &lt;mx:Fade duration="500" /&gt;
        &lt;mx:Move yFrom="0"
                easingFunction="Elastic.easeOut"
                duration="1000" /&gt;
    &lt;/mx:Parallel&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="button"
                label="Click me"
                click="showAlert();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/bin/main.html" width="100%" height="400"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_creationCompleteEffect_test_3/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/ --&gt;
&lt;mx:Application name="Alert_creationCompleteEffect_test_3"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.controls.Alert;
            import mx.controls.Button;
            import mx.effects.easing.*;
            import mx.effects.Fade;
            import mx.effects.Move;
            import mx.effects.Parallel;

            [Embed(systemFont="Verdana",
                    fontName="VerdanaEmbedded",
                    fontWeight="normal",
                    mimeType="application/x-font")]
            private const verdanaEmbeddedNormal:Class;

            [Embed(systemFont="Verdana",
                    fontName="VerdanaEmbedded",
                    fontWeight="bold",
                    mimeType="application/x-font")]
            private const verdanaEmbeddedBold:Class;

            public var alertCreationCompleteEffect:Parallel;

            private var button:Button;

            private function init():void {
                var fader:Fade = new Fade();
                fader.duration = 500;

                var mover:Move = new Move();
                mover.yFrom = 0;
                mover.easingFunction = Elastic.easeOut;
                mover.duration = 1000;

                alertCreationCompleteEffect = new Parallel();
                alertCreationCompleteEffect.addChild(fader);
                alertCreationCompleteEffect.addChild(mover);

                button = new Button();
                button.label = "Click me";
                button.addEventListener(MouseEvent.CLICK, button_click);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(button);
                addChildAt(appControlBar, 0);

                var alertStyles:CSSStyleDeclaration;
                alertStyles = StyleManager.getStyleDeclaration("Alert");
                alertStyles.setStyle("fontFamily", "VerdanaEmbedded");
            }

            private function button_click(evt:MouseEvent):void {
                showAlert();
            }

            private function showAlert():void {
                var a:Alert = Alert.show("Nam vel nunc sed arcu fringilla fringilla. Cras dapibus nunc ut nisi.\\n" +
                        "Nullam porttitor mi et mauris.\\n" +
                        "Suspendisse hendrerit, turpis eu ornare suscipit, nulla sem tempus lorem,\\n" +
                        "sit amet semper nibh mi cursus neque.\\n" +
                        "Nulla vel purus. Sed a nulla. Quisque venenatis laoreet mi.",
                        "Lorem ipsum dolor sit amet, consectetuer adipiscing elit");
                a.setStyle("creationCompleteEffect", alertCreationCompleteEffect);
                a.isPopUp = false;
                a.cacheAsBitmap = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a custom creation complete effect on a Flex Alert control (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/',contentID: 'post-799',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'creationCompleteEffect',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/09/15/creating-a-custom-creation-complete-effect-on-a-flex-alert-control-redux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

