<?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; DateChooser</title>
	<atom:link href="http://blog.desizen.com/TAG/datechooser/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.desizen.com</link>
	<description>FLEX,网络安全,Linux</description>
	<lastBuildDate>Fri, 14 May 2010 05:52:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>FLEX例子之日期选择表(DateChooser)</title>
		<link>http://blog.desizen.com/4lone/278.html</link>
		<comments>http://blog.desizen.com/4lone/278.html#comments</comments>
		<pubDate>Wed, 24 Dec 2008 08:03:47 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[FLEX]]></category>
		<category><![CDATA[DateChooser]]></category>
		<category><![CDATA[TourDeFlex]]></category>
		<category><![CDATA[例子]]></category>

		<guid isPermaLink="false">http://www.joelove.cn/?p=278</guid>
		<description><![CDATA[这个例子进行的是UI Controls:Data Entry Controls:DateChooser 例子: &#60;?xml version=&#34;1.0&#34;?&#62; &#60;!-- Simple example to demonstrate DateChooser control. --&#62; &#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;horizontal&#34; verticalAlign=&#34;top&#34; horizontalAlign=&#34;center&#34; backgroundGradientColors=&#34;[0x000000,0x323232]&#34; paddingTop=&#34;0&#34; paddingBottom=&#34;0&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62; &#60;!--这个例子实现了两个dateChooser,可以按照年月来选择.当选择了日期,所选择的数据使用两种不同的方法进行传递,并按照两种不同的格式显示在label里--&#62; &#60;mx:Script&#62; &#60;![CDATA[ &#160; // Event handler function to write the selected // date to the Label control. private function displayDate(date:Date):void { if (date == null) selection.text = &#34;Date selected: &#34;; [...]]]></description>
			<content:encoded><![CDATA[<p>这个例子进行的是UI Controls:Data Entry Controls:<a href="http://blog.desizen.com/TAG/datechooser" class="st_tag internal_tag" rel="tag" title="Posts tagged with DateChooser">DateChooser</a><br />
例子:<span id="more-278"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Simple example to demonstrate DateChooser control. --&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;horizontal&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> paddingBottom=<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>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!--这个例子实现了两个dateChooser,可以按照年月来选择.当选择了日期,所选择的数据使用两种不同的方法进行传递,并按照两种不同的格式显示在label里--&gt;</span></span>
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
&nbsp;
<span style="color: #339933;">            // Event handler function to write the selected</span>
<span style="color: #339933;">            // date to the Label control.        </span>
<span style="color: #339933;">            private function displayDate(date:Date):void {</span>
<span style="color: #339933;">                if (date == null)</span>
<span style="color: #339933;">                    selection.text = &quot;Date selected: &quot;;</span>
<span style="color: #339933;">                else</span>
<span style="color: #339933;">                    selection.text = &quot;Date selected: &quot; + date.getFullYear().toString() +</span>
<span style="color: #339933;">                        '/' + (date.getMonth()+1).toString() + '/' + date.getDate();</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:DateFormatter</span> id=<span style="color: #ff0000;">&quot;df&quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--这个的作用是进行格式化日期所使用的,查看as3帮助就知道了--&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Panel</span> title=<span style="color: #ff0000;">&quot;DateChooser Control Example&quot;</span> width=<span style="color: #ff0000;">&quot;600&quot;</span> color=<span style="color: #ff0000;">&quot;0xffffff&quot;</span> borderAlpha=<span style="color: #ff0000;">&quot;0.15&quot;</span> height=<span style="color: #ff0000;">&quot;240&quot;</span></span>
<span style="color: #000000;">       layout=<span style="color: #ff0000;">&quot;horizontal&quot;</span> horizontalGap=<span style="color: #ff0000;">&quot;15&quot;</span> paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;0&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;0&quot;</span> horizontalScrollPolicy=<span style="color: #ff0000;">&quot;off&quot;</span> verticalScrollPolicy=<span style="color: #ff0000;">&quot;off&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
           <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VBox</span><span style="color: #7400FF;">&gt;</span></span>
          <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> text=<span style="color: #ff0000;">&quot;Simple DateChooser Control&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
          <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DateChooser</span> id=<span style="color: #ff0000;">&quot;dateChooser1&quot;</span> yearNavigationEnabled=<span style="color: #ff0000;">&quot;true&quot;</span>  height=<span style="color: #ff0000;">&quot;145&quot;</span>   </span>
<span style="color: #000000;">              change=<span style="color: #ff0000;">&quot;displayDate(DateChooser(event.target).selectedDate)&quot;</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--yearNavigationEnabled属性为true的时候启用年份导航,这是第一种传递方式--&gt;</span></span>
          <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;selection&quot;</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> text=<span style="color: #ff0000;">&quot;Date selected:&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><span style="color: #7400FF;">&gt;</span></span>
          <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> text=<span style="color: #ff0000;">&quot;Disable dates before Oct 31st, 2008&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
          <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DateChooser</span> id=<span style="color: #ff0000;">&quot;dateChooser2&quot;</span> yearNavigationEnabled=<span style="color: #ff0000;">&quot;true&quot;</span> width=<span style="color: #ff0000;">&quot;175&quot;</span> height=<span style="color: #ff0000;">&quot;145&quot;</span></span>
<span style="color: #000000;">              disabledRanges=<span style="color: #ff0000;">&quot;{[ {rangeEnd: new Date(2008, 9, 31)} ]}&quot;</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--这里的disabledRanges是禁用天数,注意,日期中的月份是从零开始计算的--&gt;</span></span>
          <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> color=<span style="color: #ff0000;">&quot;0x323232&quot;</span> text=<span style="color: #ff0000;">&quot;Date selected: {df.format(dateChooser2.selectedDate)}&quot;</span><span style="color: #7400FF;">/&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--这里的是一个数据绑定,调用了DateFormatter来进行格式化然后显示出来的--&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;30%&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> text=<span style="color: #ff0000;">&quot;Select a date in the DateChooser control.&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> text=<span style="color: #ff0000;">&quot;Select it again while holding down the Control key to clear it.&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/datechooser" title="DateChooser" rel="tag">DateChooser</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/420.html" title="FLEX例子之按钮条(ButtonBar) (2009年2月4日)">FLEX例子之按钮条(ButtonBar)</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/285.html" title="FLEX例子之日期弹出选择框(DateField) (2008年12月26日)">FLEX例子之日期弹出选择框(DateField)</a> (2)</li>
	<li><a href="http://blog.desizen.com/4lone/231.html" title="flex-for循环语句 (2008年11月17日)">flex-for循环语句</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/539.html" title="FLEX例子之OLAP数据表(OLAPDataGrid) (2009年2月25日)">FLEX例子之OLAP数据表(OLAPDataGrid)</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/403.html" title="FLEX例子之切换按钮条(ToggleButtonBar) (2009年1月14日)">FLEX例子之切换按钮条(ToggleButtonBar)</a> (0)</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/401.html" title="FLEX例子之弹出按钮(PopUpButton) (2009年1月14日)">FLEX例子之弹出按钮(PopUpButton)</a> (0)</li>
	<li><a href="http://blog.desizen.com/4lone/595.html" title="Flex BugQuash (2009年3月11日)">Flex BugQuash</a> (0)</li>
	<li><a href="http://blog.desizen.com/sitemap" title="SiteMap (2008年6月10日)">SiteMap</a> (1)</li>
	<li><a href="http://blog.desizen.com/4lone/589.html" title="FLEX例子之VideoDisplay(FLV视频播放器) (2009年3月10日)">FLEX例子之VideoDisplay(FLV视频播放器)</a> (1)</li>
</ul>

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