<?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>joel&#039;s FLEX blog &#187; Alert</title>
	<atom:link href="http://blog.desizen.com/TAG/alert/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.desizen.com</link>
	<description>FLEX,网络安全,Linux</description>
	<lastBuildDate>Fri, 13 May 2011 02:18:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>FLEX例子之弹出提示窗口(Alert)</title>
		<link>http://blog.desizen.com/4lone/549.html</link>
		<comments>http://blog.desizen.com/4lone/549.html#comments</comments>
		<pubDate>Tue, 03 Mar 2009 05:57:00 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[FLEX]]></category>
		<category><![CDATA[Alert]]></category>
		<category><![CDATA[TourDeFlex]]></category>
		<category><![CDATA[例子]]></category>

		<guid isPermaLink="false">http://www.joelove.cn/?p=549</guid>
		<description><![CDATA[这个例子进行的是Tourdeflex:UI Controls:Other Controls:Alert 简介: The Alert control is a pop-up dialog box that can contain a message, a title, buttons (any combination of OK, Cancel, Yes, and No) and an icon. The Alert control is modal, which means it will retain focus until the user closes it. 例子: &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;top&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>这个例子进行的是<a href="http://blog.desizen.com/TAG/tourdeflex" class="st_tag internal_tag" rel="tag" title="Posts tagged with TourDeFlex">Tourdeflex</a>:UI Controls:Other Controls:<a href="http://blog.desizen.com/TAG/alert" class="st_tag internal_tag" rel="tag" title="Posts tagged with Alert">Alert</a><br />
简介:<br />
The <a href="http://blog.desizen.com/TAG/alert" class="st_tag internal_tag" rel="tag" title="Posts tagged with Alert">Alert</a> control is a pop-up dialog box that can contain a message, a title, buttons (any combination of OK, Cancel, Yes, and No) and an icon. The <a href="http://blog.desizen.com/TAG/alert" class="st_tag internal_tag" rel="tag" title="Posts tagged with Alert">Alert</a> control is modal, which means it will retain focus until the user closes it.<br />
例子:</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: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;vertical&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;top&quot;</span></span>
<span style="color: #000000;">    horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> backgroundGradientColors=<span style="color: #ff0000;">&quot;[0x000000,0x323232]&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;0&quot;</span> viewSourceURL=<span style="color: #ff0000;">&quot;srcview/index.html&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>
<span style="color: #339933;">            import mx.events.CloseEvent;</span>
&nbsp;
<span style="color: #339933;">            // Event handler function uses a static method to show</span>
<span style="color: #339933;">            // a pop-up window with the title, message, and requested buttons.        </span>
<span style="color: #339933;">            private function clickHandler(event:Event):void {</span>
<span style="color: #339933;">                Alert.yesLabel = &quot;Yes&quot;;</span>
<span style="color: #339933;">                Alert.noLabel = &quot;No&quot;;</span>
<span style="color: #339933;">                Alert.show(&quot;Do you want to save your changes?&quot;, &quot;Save Changes&quot;, 3, this, alertClickHandler);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            // Event handler function for displaying the selected Alert button.</span>
<span style="color: #339933;">            private function alertClickHandler(event:CloseEvent):void {</span>
<span style="color: #339933;">                if (event.detail==Alert.YES)</span>
<span style="color: #339933;">                    status.text=&quot;You answered Yes&quot;;</span>
<span style="color: #339933;">                else</span>
<span style="color: #339933;">                    status.text=&quot;You answered No&quot;;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            // Event handler function changes the default Button labels and sets the</span>
<span style="color: #339933;">            // Button widths. If you later use an Alert with the default Buttons, </span>
<span style="color: #339933;">            // you must reset these values.</span>
<span style="color: #339933;">            private function secondClickHandler(event:Event):void {</span>
<span style="color: #339933;">                Alert.buttonWidth = 100;//多于两个按钮时,需要设置宽度</span>
<span style="color: #339933;">                Alert.yesLabel = &quot;Cool&quot;;</span>
<span style="color: #339933;">                Alert.noLabel = &quot;Lame&quot;;</span>
<span style="color: #339933;">                Alert.cancelLabel = &quot;Never Mind&quot;;</span>
&nbsp;
<span style="color: #339933;">                Alert.show(&quot;Do you want to save your changes?&quot;,&quot;Save Changes&quot;,1|2|8,this,alertClickHandler);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!--使用了css--&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        .alertTitle{
            color:#ffffff;
            fontWeight:bold;
        }
        Alert{
            backgroundColor:#E3E3E3;
            /* backgroundAlpha: 0.8; */
            color: #323232;
            borderColor: #000000;
            borderAlpha: 0.7;
            headerHeight:20;
            themeColor: #848484;
            titleStyleName:alertTitle;
&nbsp;
        }
    <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: #7400FF;">&lt;mx:Panel</span> title=<span style="color: #ff0000;">&quot;Alert Control&quot;</span> layout=<span style="color: #ff0000;">&quot;horizontal&quot;</span> color=<span style="color: #ff0000;">&quot;0xffffff&quot;</span> borderAlpha=<span style="color: #ff0000;">&quot;0.15&quot;</span> width=<span style="color: #ff0000;">&quot;500&quot;</span></span>
<span style="color: #000000;">         paddingTop=<span style="color: #ff0000;">&quot;2&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span> paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
         <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VBox</span> width=<span style="color: #ff0000;">&quot;33%&quot;</span> borderColor=<span style="color: #ff0000;">&quot;0xACACAC&quot;</span> borderStyle=<span style="color: #ff0000;">&quot;solid&quot;</span> borderThickness=<span style="color: #ff0000;">&quot;1&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Text</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> textAlign=<span style="color: #ff0000;">&quot;center&quot;</span></span>
<span style="color: #000000;">              text=<span style="color: #ff0000;">&quot;Click the button below to display a simple Alert window.&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
              <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Click Me&quot;</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> click=<span style="color: #ff0000;">&quot;Alert.show('Hello World!', 'Message');&quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--只显示一个ok按钮--&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:VBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VBox</span> width=<span style="color: #ff0000;">&quot;33%&quot;</span>  borderColor=<span style="color: #ff0000;">&quot;0xACACAC&quot;</span> borderStyle=<span style="color: #ff0000;">&quot;solid&quot;</span> borderThickness=<span style="color: #ff0000;">&quot;1&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
             <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Text</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> textAlign=<span style="color: #ff0000;">&quot;center&quot;</span></span>
<span style="color: #000000;">              text=<span style="color: #ff0000;">&quot;Click the button below to display an Alert window and capture the button pressed by the user.&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
              <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Click Me&quot;</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> click=<span style="color: #ff0000;">&quot;clickHandler(event);&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;status&quot;</span> color=<span style="color: #ff0000;">&quot;0x0050AA&quot;</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:VBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VBox</span> width=<span style="color: #ff0000;">&quot;33%&quot;</span>  borderColor=<span style="color: #ff0000;">&quot;0xACACAC&quot;</span> borderStyle=<span style="color: #ff0000;">&quot;solid&quot;</span> borderThickness=<span style="color: #ff0000;">&quot;1&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
              <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Text</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> textAlign=<span style="color: #ff0000;">&quot;center&quot;</span></span>
<span style="color: #000000;">              text=<span style="color: #ff0000;">&quot;Click the button below to display an Alert window that uses custom Button labels.&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
              <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Click Me&quot;</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> click=<span style="color: #ff0000;">&quot;secondClickHandler(event);&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
         <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:VBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Panel</span><span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>


	标签：<a href="http://blog.desizen.com/TAG/alert" title="Alert" rel="tag">Alert</a>, <a href="http://blog.desizen.com/TAG/flex" title="FLEX" rel="tag">FLEX</a>, <a href="http://blog.desizen.com/TAG/tourdeflex" title="TourDeFlex" rel="tag">TourDeFlex</a>, <a href="http://blog.desizen.com/TAG/%e4%be%8b%e5%ad%90" title="例子" rel="tag">例子</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://blog.desizen.com/4lone/647.html" title="说说最近的事 (2009年4月3日)">说说最近的事</a> (1)</li>
	<li><a href="http://blog.desizen.com/4lone/586.html" title="FLEX例子 &#8211; SWFloader(SWF加载器) (2009年3月10日)">FLEX例子 &#8211; SWFloader(SWF加载器)</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/426.html" title="FLEX例子之链接按钮(LinkButton) (2009年2月5日)">FLEX例子之链接按钮(LinkButton)</a> (1)</li>
	<li><a href="http://blog.desizen.com/4lone/271.html" title="FLEX例子之下拉列表框(ComboBox) (2008年12月23日)">FLEX例子之下拉列表框(ComboBox)</a> (1)</li>
	<li><a href="http://blog.desizen.com/4lone/644.html" title="FLEX例子 &#8211; DividedBox(分割盒子) (2009年4月2日)">FLEX例子 &#8211; DividedBox(分割盒子)</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/568.html" title="FLEX例子之进程条(ProgressBar) (2009年3月6日)">FLEX例子之进程条(ProgressBar)</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/628.html" title="FLEX例子 &#8211; Canvas(画布) (2009年3月31日)">FLEX例子 &#8211; Canvas(画布)</a> (1)</li>
	<li><a href="http://blog.desizen.com/4lone/676.html" title="TourDeFlex又更新了 (2009年4月17日)">TourDeFlex又更新了</a> (2)</li>
	<li><a href="http://blog.desizen.com/4lone/199.html" title="KingCMS之模块管理 (2008年10月27日)">KingCMS之模块管理</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/431.html" title="在flex中应用css样式详解 (2009年2月5日)">在flex中应用css样式详解</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.desizen.com/4lone/549.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

