<?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; cancelLabel</title>
	<atom:link href="http://blog.flexexamples.com/tag/cancellabel/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>Changing the default button labels on an Alert control</title>
		<link>http://blog.flexexamples.com/2007/07/25/changing-the-default-button-labels-on-an-alert-control/</link>
		<comments>http://blog.flexexamples.com/2007/07/25/changing-the-default-button-labels-on-an-alert-control/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 03:44:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Alert]]></category>
		<category><![CDATA[cancelLabel]]></category>
		<category><![CDATA[noLabel]]></category>
		<category><![CDATA[okLabel]]></category>
		<category><![CDATA[yesLabel]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/07/25/changing-the-default-button-labels-on-an-alert-control/</guid>
		<description><![CDATA[<p>When I first started playing with the Alert control, this tripped me up for a couple minutes. When trying to override the default text on the Alert control&#8217;s buttons, you need to set the Alert.cancelLabel, Alert.noLabel, Alert.okLabel, and/or Alert.yesLabel static properties *before* calling the Alert.show(). Sure, sounds a bit obvious in hindsight, but it is [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started playing with the Alert control, this tripped me up for a couple minutes. When trying to override the default text on the Alert control&#8217;s buttons, you need to set the <code>Alert.cancelLabel</code>, <code>Alert.noLabel</code>, <code>Alert.okLabel</code>, and/or <code>Alert.yesLabel</code> static properties *before* calling the <code>Alert.show()</code>. Sure, sounds a bit obvious in hindsight, but it is also important to remember that since those values are static, they apply to all Alerts, not just the one specific Alert. So you may have to reset the values back to their defaults once the Alert has been displayed.</p>
<p><span id="more-30"></span></p>
<p>The following example displays an Alert dialog and overrides the default values for the <code>Alert.noLabel</code> and <code>Alert.yesLabel</code> properties:</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/07/25/changing-the-default-button-labels-on-an-alert-control/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Alert_noLabel_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 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 function showAlert():void {</span>
<span style="color: #339933;">                Alert.noLabel = &quot;Non&quot;;</span>
<span style="color: #339933;">                Alert.yesLabel = &quot;Oui&quot;;</span>
&nbsp;
<span style="color: #339933;">                Alert.show(&quot;message goes here&quot;,</span>
<span style="color: #339933;">                        &quot;title goes here&quot;,</span>
<span style="color: #339933;">                        Alert.NO | Alert.YES);</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:Button</span> label=<span style="color: #ff0000;">&quot;Alert.show()&quot;</span></span>
<span style="color: #000000;">            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>

<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://blog.flexexamples.com/wp-content/uploads/Alert_noLabel_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_noLabel_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the default button labels on an Alert control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/07/25/changing-the-default-button-labels-on-an-alert-control/',contentID: 'post-30',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Alert,cancelLabel,noLabel,okLabel,yesLabel',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/07/25/changing-the-default-button-labels-on-an-alert-control/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

