<?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; messageStyleName</title>
	<atom:link href="http://blog.flexexamples.com/tag/messagestylename/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>Styling the Alert control&#8217;s message text</title>
		<link>http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/</link>
		<comments>http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 15:34:35 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[messageStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/</guid>
		<description><![CDATA[<p>The following example shows how you can customize the appearance of the message text in an Alert control in Flex by setting the messageStyleName style:</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_messageStyleName_fontFamily_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Style&#62; @font-face { src: local("Comic Sans MS"); fontFamily: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can customize the appearance of the message text in an Alert control in Flex by setting the <code>messageStyleName</code> style:</p>
<p>Full code after the jump.</p>
<p><span id="more-413"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_messageStyleName_fontFamily_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Comic Sans MS");
            fontFamily: myComicSansMS;
            fontWeight: normal;
        }

        @font-face {
            src: local("Comic Sans MS");
            fontFamily: myComicSansMS;
            fontWeight: bold;
        }

        Alert {
            messageStyleName: myCustomMessageStyleName;
        }

        .myCustomMessageStyleName {
            color: haloOrange;
            fontFamily: myComicSansMS;
            fontSize: 10;
            fontWeight: normal;
        }
    &lt;/mx:Style&gt;

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

            private var alert:Alert;

            private function init():void {
                var myMessage:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\\nDonec tincidunt sollicitudin sem.";
                var myTitle:String = "The quick brown fox jumped over the lazy dog";
                alert = Alert.show(myMessage, myTitle);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="Launch alert" click="init();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_messageStyleName_fontFamily_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_messageStyleName_fontFamily_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>As you can see, setting the font family and font size on the Alert control&#8217;s message also caused the styles to be changed in the title bar, which is why we embedded both the normal and bold fonts into the application. If you want to override the styles in the title area, see <a href="http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-title-bar/">&#8220;Styling the Alert control&#8217;s title bar&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the Alert control\&#039;s message text on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/',contentID: 'post-413',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'messageStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-message-text/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Styling the Flex Alert control</title>
		<link>http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/</link>
		<comments>http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 05:15:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[Embed]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[@font face]]></category>
		<category><![CDATA[buttonStyleName]]></category>
		<category><![CDATA[messageStyleName]]></category>
		<category><![CDATA[titleStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/</guid>
		<description><![CDATA[<p>This is a more complex version of my previous example. This time in addition to making the Alert control&#8217;s text non-selectable, we use an embedded font for the Alert title, message, buttons, as well as edit the drop shadow, remove the rounded corners, and remove the button skins.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/ --&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a more complex version of my previous example. This time in addition to making the Alert control&#8217;s text non-selectable, we use an embedded font for the Alert title, message, buttons, as well as edit the drop shadow, remove the rounded corners, and remove the button skins.</p>
<p><span id="more-79"></span></p>
<p class="alert">Since this example uses the <strong>mx_internal</strong> namespace, you can't always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk.</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/2007/08/11/styling-the-flex-alert-control/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Alert_style_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">        creationComplete=<span style="color: #ff0000;">&quot;showAlert()&quot;</span></span>
<span style="color: #000000;">        applicationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Used by the ApplicationControlBar control. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;fileName&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;fileSize&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Used by the Alert control. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;message&quot;</span><span style="color: #7400FF;">&gt;</span></span>The quick brown fox jumped over the lazy dog.
&nbsp;
The quick brown fox jumped over the lazy dog.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:String</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:String</span> id=<span style="color: #ff0000;">&quot;title&quot;</span><span style="color: #7400FF;">&gt;</span></span>The quick brown fox jumped over the lazy dog?<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:String</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.controls.Alert;</span>
&nbsp;
<span style="color: #339933;">            private var a:Alert;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                var appInfo:LoaderInfo = Application.application.loaderInfo;</span>
<span style="color: #339933;">                /* Just grab the filename from the SWF URL. */</span>
<span style="color: #339933;">                fileName = (appInfo.url).split(&quot;/&quot;).pop();</span>
<span style="color: #339933;">                /* Convert bytes to kilobytes. */</span>
<span style="color: #339933;">                fileSize = (appInfo.bytesTotal / 1024).toFixed(2);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function showAlert():void {</span>
<span style="color: #339933;">                Alert.yesLabel = &quot;Accept&quot;;</span>
<span style="color: #339933;">                Alert.noLabel = &quot;Reject&quot;;</span>
<span style="color: #339933;">                Alert.buttonWidth = 120;</span>
&nbsp;
<span style="color: #339933;">                a = Alert.show(</span>
<span style="color: #339933;">                        message,</span>
<span style="color: #339933;">                        title,</span>
<span style="color: #339933;">                        Alert.NO | Alert.YES</span>
<span style="color: #339933;">                    );</span>
<span style="color: #339933;">                /* Make the Alert form's text non-selectable. */</span>
<span style="color: #339933;">                a.mx_internal::alertForm.mx_internal::textField.selectable = false;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @font-face{
            src: url(&quot;./fonts/base02.ttf&quot;);
            fontFamily: &quot;Base02&quot;;
        }
&nbsp;
        Alert {
            titleStyleName: &quot;alertTitle&quot;;
            messageStyleName: &quot;alertMessage&quot;;
            buttonStyleName: &quot;alertButton&quot;;
            dropShadowEnabled: true;
            shadowDistance: 5;
            shadowDirection: right;
            cornerRadius: 0;
            embedFonts: true;
            fontFamily: Base02;
        }
&nbsp;
        .alertTitle {
            letterSpacing: 0;
            fontSize: 14;
            color: red;
        }
&nbsp;
        .alertMessage {
            letterSpacing: 0;
            fontSize: 10;
            fontWeight: normal;
            color: black;
        }
&nbsp;
        .alertButton {
            letterSpacing: 0;
            fontSize: 11;
            cornerRadius: 10;
            fontWeight: normal;
            textRollOverColor: white;
            color: red;
            skin: ClassReference(null);
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Display SWF name and file size. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> id=<span style="color: #ff0000;">&quot;applicationControlBar&quot;</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;info&quot;</span> text=<span style="color: #ff0000;">&quot;{fileName} ({fileSize}kb)&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: #808080; font-style: italic;">&lt;!-- Click to launch Alert control. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Launch Alert&quot;</span> click=<span style="color: #ff0000;">&quot;showAlert();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Alert_style_test/bin/srcview/index.html">View source</a> is enabled in the following application.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/Alert_style_test/bin/main.html" width="100%" height="250"></iframe></p>
<p class="alert">Base 02 font by <a href="http://www.stereo-type.net/">www.stereo-type.net</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the Flex Alert control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/',contentID: 'post-79',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '@font face,buttonStyleName,messageStyleName,titleStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/11/styling-the-flex-alert-control/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

