<?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>be easy</title>
	<atom:link href="http://www.beasy.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.beasy.org</link>
	<description>beasy&#039;s blog - All about flex, as3, air, framework, design pattern</description>
	<lastBuildDate>Mon, 22 Mar 2010 06:20:00 +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>Flash Builder 4安装程序采用AIR技术</title>
		<link>http://www.beasy.org/2010/03/flex-builder-4%e5%ae%89%e8%a3%85%e7%a8%8b%e5%ba%8f%e9%87%87%e7%94%a8air%e6%8a%80%e6%9c%af/</link>
		<comments>http://www.beasy.org/2010/03/flex-builder-4%e5%ae%89%e8%a3%85%e7%a8%8b%e5%ba%8f%e9%87%87%e7%94%a8air%e6%8a%80%e6%9c%af/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 06:17:37 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[原创文章]]></category>
		<category><![CDATA[行业资讯]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[FlashBuilder]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=156</guid>
		<description><![CDATA[刚刚在安装新下载的Flash Builder4正式版,从整个安装向导UI来看极像是用AIR程序做的。 AIR2.0已经支持将程序打包为可直接执行的exe文件。 安装向导用AIR2.0解决方案，即能体现AIR2.0的特性又给自己的产品做了一次值入式广告，真是一举两得!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.beasy.org/wp-content/uploads/2010/03/flex4.jpg"><img class="size-full wp-image-157 alignnone" title="flex4" src="http://www.beasy.org/wp-content/uploads/2010/03/flex4.jpg" alt="" width="815" height="552" /></a></p>
<p>刚刚在安装新下载的Flash Builder4正式版,从整个安装向导UI来看极像是用AIR程序做的。</p>
<p>AIR2.0已经支持将程序打包为可直接执行的exe文件。</p>
<p>安装向导用AIR2.0解决方案，即能体现AIR2.0的特性又给自己的产品做了一次值入式广告，真是一举两得!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/03/flex-builder-4%e5%ae%89%e8%a3%85%e7%a8%8b%e5%ba%8f%e9%87%87%e7%94%a8air%e6%8a%80%e6%9c%af/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Builder 4 正式版发布</title>
		<link>http://www.beasy.org/2010/03/flash-builder-4-%e6%ad%a3%e5%bc%8f%e7%89%88%e5%8f%91%e5%b8%83/</link>
		<comments>http://www.beasy.org/2010/03/flash-builder-4-%e6%ad%a3%e5%bc%8f%e7%89%88%e5%8f%91%e5%b8%83/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 04:39:55 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[行业资讯]]></category>
		<category><![CDATA[FlashBuilder]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=153</guid>
		<description><![CDATA[千呼万唤始出来,期盼已久的Flash Builder4 正式版今天终于发布了。 我也在下载中，希望会有令人心动的改进。 点击这里下载。]]></description>
			<content:encoded><![CDATA[<p>千呼万唤始出来,期盼已久的Flash Builder4 正式版今天终于发布了。<br />
我也在下载中，希望会有令人心动的改进。<br />
点击<a href="http://www.adobe.com/cfusion/tdrc/index.cfm?product=flash_builder">这里</a>下载。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/03/flash-builder-4-%e6%ad%a3%e5%bc%8f%e7%89%88%e5%8f%91%e5%b8%83/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>上海 第二期FLASH专家交流会 3月28日</title>
		<link>http://www.beasy.org/2010/03/%e4%b8%8a%e6%b5%b7-%e7%ac%ac%e4%ba%8c%e6%9c%9fflash%e4%b8%93%e5%ae%b6%e4%ba%a4%e6%b5%81%e4%bc%9a-3%e6%9c%8828%e6%97%a5/</link>
		<comments>http://www.beasy.org/2010/03/%e4%b8%8a%e6%b5%b7-%e7%ac%ac%e4%ba%8c%e6%9c%9fflash%e4%b8%93%e5%ae%b6%e4%ba%a4%e6%b5%81%e4%bc%9a-3%e6%9c%8828%e6%97%a5/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 14:09:39 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[RIA聚会]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[ria]]></category>
		<category><![CDATA[swfsh]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=142</guid>
		<description><![CDATA[第二期FLASH专家交流会 3月28日 上海 畅星大厦 活动主题: 新技术和开发经验 正在火热报名中！免费参加，座位有限，快来报名 SWFSH.COM 话题介绍 FLASH基于对象的优化技术 主讲人：盛大网络 黄炎中 职业生涯：05年进入盛大。 &#60;疯狂赛车&#62;主程； &#60;英雄连OL&#62;主程； &#60;传世群英传网页版&#62;WEBGAME用户体验设计师，项目经理，系统架构师。 FLASH PLAYER 多元件性能测试报告 主讲人：鞠海深 海底世界创始团队成员，前端核心开发人员。 Flash图像开发杂谈 主讲人：李明 曾就职于中国MacroMedia总代Itom公司，和讯，盛大，数字鱼，微软等公司，做flash商业项目多年，对flash开发及结合传统语言开发有多年的研究，现是盛大18公司之一翼牛网络的创始人，开发盛大平台下的大型flash网页游戏。 Isometric位图引擎的构建 主讲人：史珉 将为大家讲述以下内容： Display Object Node Tree与Event Bubbling ； 位图与MovieClip ； 遮挡与排序； 鼠标动作捕捉； 优化：Object Pool；如何减少排序及遮挡计算；寻径及四叉树； Papervision3d开发流程及商业应用 主讲人：孙令纯 介绍Papervision3D (简称PV3D)，PV3D是一套开源的3D应用，结合 ActionScript 3.0 的高效能，制作出更多更炫的FLASH 3D应用。在全球已有许多的知名网站运用此技术。演讲内容以范例为导向，着重于实际应用，让您在短时间内扎扎实实制作出每一个ActionScript程序。 AIR的数据缓存及数据绑定的列表操作模式 主讲人：徐哲 Doit.im 创始人。 10多年企业应用开发经验。 专业以Java/Ruby/C++/AS3/JavaScript/Objective-C为主；业余爱好经济和哲学、历史。 Flex上主要应用有Doit.im, 路灯、电缆监控与防盗系统。 [...]]]></description>
			<content:encoded><![CDATA[<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<pre><span style="color: #008000;"><strong>第二期</strong><strong>FLASH</strong><strong>专家交流会</strong><strong> 3月28日</strong><strong> </strong><strong>上海</strong><strong> </strong><strong>畅星大厦</strong></span></pre>
<pre><span style="color: #008000;"><strong>活动主题</strong><strong>:</strong> <strong>新技术和开发经验</strong></span></pre>
<p><a href="http://swfsh.com/join"><strong>正在火热报名中！免费参加，座位有限，快来报名</strong><strong> SWFSH.COM</strong></a></p>
<hr size="3" noshade="noshade" /><strong>话题介绍</strong><strong> </strong></p>
<p><span style="color: #ff0000;"><strong>FLASH</strong><strong>基于对象的优化技术</strong></span></p>
<p><img class="alignleft" title="hyz" src="http://swfsh.com/images/hyz.gif" alt="" width="96" height="96" /><span style="color: #000000;">主讲人：盛大网络 黄炎中</span></p>
<p>职业生涯：05年进入盛大。<br />
&lt;疯狂赛车&gt;主程；<br />
&lt;英雄连OL&gt;主程；<br />
&lt;传世群英传网页版&gt;WEBGAME用户体验设计师，项目经理，系统架构师。</p>
<p><span style="color: #ff0000;"><strong>FLASH PLAYER </strong><strong>多元件性能测试报告</strong></span></p>
<p><strong><img class="alignleft" title="jhq" src="http://swfsh.com/images/jhs.jpg" alt="" width="96" height="96" />主讲人</strong>：鞠海深<br />
海底世界创始团队成员，前端核心开发人员。</p>
<p><span style="color: #ff0000;"><strong> </strong></span></p>
<p><span style="color: #ff0000;"><strong><br />
</strong></span><br />
<br />
<span style="color: #ff0000;"><strong>Flash</strong><strong>图像开发杂谈</strong></span></p>
<p><strong><img class="alignleft" title="lm" src="http://swfsh.com/images/lm.jpg" alt="" width="96" height="96" />主讲人</strong>：李明<br />
曾就职于中国MacroMedia总代Itom公司，和讯，盛大，数字鱼，微软等公司，做flash商业项目多年，对flash开发及结合传统语言开发有多年的研究，现是盛大18公司之一翼牛网络的创始人，开发盛大平台下的大型flash网页游戏。</p>
<p><strong> </strong></p>
<p>
<span style="color: #ff0000;"><strong>Isometric</strong><strong>位图引擎的构建</strong></span><strong> </strong></p>
<p><strong><img class="alignleft" title="sm" src="http://swfsh.com/images/sm.jpg" alt="" width="96" height="96" />主讲人</strong>：史珉<br />
将为大家讲述以下内容：<br />
Display Object Node Tree与Event Bubbling ；<br />
位图与MovieClip ；<br />
遮挡与排序；<br />
鼠标动作捕捉；<br />
优化：Object Pool；如何减少排序及遮挡计算；寻径及四叉树；</p>
<p>
<span style="color: #ff0000;"><strong>Papervision3d</strong><strong>开发流程及商业应用</strong></span></p>
<p><strong><img class="alignleft" title="slc" src="http://swfsh.com/images/slc.jpg" alt="" width="96" height="97" />主讲人</strong>：孙令纯<br />
介绍Papervision3D (简称PV3D)，PV3D是一套开源的3D应用，结合 ActionScript 3.0 的高效能，制作出更多更炫的FLASH 3D应用。在全球已有许多的知名网站运用此技术。演讲内容以范例为导向，着重于实际应用，让您在短时间内扎扎实实制作出每一个ActionScript程序。</p>
<p><strong> </strong></p>
<p>
<span style="color: #ff0000;"><strong>AIR</strong><strong>的数据缓存及数据绑定的列表操作模式</strong></span></p>
<p><strong><img class="alignleft" title="xz" src="http://swfsh.com/images/xz.jpg" alt="" width="96" height="96" />主讲人</strong>：徐哲<br />
Doit.im 创始人。<br />
10多年企业应用开发经验。<br />
专业以Java/Ruby/C++/AS3/JavaScript/Objective-C为主；业余爱好经济和哲学、历史。<br />
Flex上主要应用有Doit.im, 路灯、电缆监控与防盗系统。<br />
主要讲述在AIR开发中，我们怎么设计我们的客户端缓存系统，所谓列表操作模式即针对集合/列表的操作和操作的结果符合数据绑定的特性。</p>
<hr size="3" noshade="noshade" /><strong>议程安排</strong><strong> </strong></p>
<p>2010年3月28日 星期日</p>
<p>12:30 ~ 13:00 参会人员签到，入场<br />
13:00 ~ 15:00 主题讨论<br />
15:00 ~ 15:30 茶歇和聊天<br />
15:30 ~ 17:30 主题讨论<br />
18:00 技术交流和讨论</p>
<hr size="3" noshade="noshade" /><strong>会议地点</strong><strong> </strong></p>
<p><span style="color: #ff0000;"><strong>畅星大厦</strong><strong>•</strong><strong>上海</strong></span></p>
<p><strong><img class="alignleft" title="address" src="http://swfsh.com/images/changxing_gate.jpg" alt="" width="208" height="156" />地址：</strong>上海浦东新区碧波路888号畅星大厦3楼会议厅<br />
<strong>电话：</strong>021-38984558<br />
<strong>网站：</strong><a href="http://www.changxing.sh.cn/dalou.htm" target="_blank">http://www.changxing.sh.cn/</a><br />
<strong>交通：</strong>161，地铁2号线张江站（步行5-10分钟即到），提供免费泊车。</p>
<p><img class="alignleft" title="google map" src="http://swfsh.com/images/changxing.jpg" alt="" width="593" height="586" /></p>
<p><a href="http://ditu.google.cn/maps?f=q&amp;source=s_q&amp;hl=zh-CN&amp;geocode=&amp;q=%E4%B8%8A%E6%B5%B7%E6%B5%A6%E4%B8%9C%E6%96%B0%E5%8C%BA%E7%A2%A7%E6%B3%A2%E8%B7%AF888%E5%8F%B7&amp;sll=31.199294,121.585318&amp;sspn=0.006864,0.013915&amp;brcurrent=3,0x35b277c0c6f38231:0x27b7e58bc9f76994,0,0x35ad8c73cd3952c7:0xbb190e9364c4e592%3B5,0,0&amp;ie=UTF8&amp;hq=&amp;hnear=%E4%B8%8A%E6%B5%B7%E5%B8%82%E6%B5%A6%E4%B8%9C%E6%96%B0%E5%8C%BA%E7%A2%A7%E6%B3%A2%E8%B7%AF888%E5%8F%B7&amp;ll=31.201203,121.589792&amp;spn=0.013729,0.027831&amp;z=16&amp;lci=transit" target="_blank">&gt;&gt; 在 Google 地图上查看</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/03/%e4%b8%8a%e6%b5%b7-%e7%ac%ac%e4%ba%8c%e6%9c%9fflash%e4%b8%93%e5%ae%b6%e4%ba%a4%e6%b5%81%e4%bc%9a-3%e6%9c%8828%e6%97%a5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Buzz!</title>
		<link>http://www.beasy.org/2010/02/hello-buzz/</link>
		<comments>http://www.beasy.org/2010/02/hello-buzz/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 17:11:45 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[生活随笔]]></category>
		<category><![CDATA[精品收藏]]></category>
		<category><![CDATA[Buzz]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=138</guid>
		<description><![CDATA[Google今天发布一款名为Google Buzz的新产品，用户将可以直接在Gmail内分享信息、连接和照片。谷歌另外还发布了一系列用于Android智能手机的新型社交网络功能。 Buzz类型是Twitter的一个社交平台，信息实时推送。试用一个小时感觉非常不错，总体上继承了Gmail的优良血统，信息会自动保存在Gmail里面以免漏读，可以把信息打上喜欢的标签，共享Picasa, Google Reader, Flickr, Twitter上的内容，还可以对消息记录打包做为邮件发送。 担心! 继Facebook, Twitter, YouTube之后， Buzz会不会也只能在我们眼前昙花一现？]]></description>
			<content:encoded><![CDATA[<p>Google今天发布一款名为Google Buzz的新产品，用户将可以直接在Gmail内分享信息、连接和照片。谷歌另外还发布了一系列用于Android智能手机的新型社交网络功能。</p>
<p>Buzz类型是Twitter的一个社交平台，信息实时推送。试用一个小时感觉非常不错，总体上继承了Gmail的优良血统，信息会自动保存在Gmail里面以免漏读，可以把信息打上喜欢的标签，共享Picasa, Google Reader, Flickr, Twitter上的内容，还可以对消息记录打包做为邮件发送。<br />
<a href="http://www.beasy.org/wp-content/uploads/2010/02/buzz.png"><img src="http://www.beasy.org/wp-content/uploads/2010/02/buzz.png" alt="" title="buzz" width="303" height="261" class="alignnone size-full wp-image-140" /></a><br />
担心! 继Facebook, Twitter, YouTube之后， Buzz会不会也只能在我们眼前昙花一现？</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/02/hello-buzz/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>自定义图表刻度标签</title>
		<link>http://www.beasy.org/2010/01/%e8%87%aa%e5%ae%9a%e4%b9%89%e5%9b%be%e8%a1%a8%e5%88%bb%e5%ba%a6%e6%a0%87%e7%ad%be/</link>
		<comments>http://www.beasy.org/2010/01/%e8%87%aa%e5%ae%9a%e4%b9%89%e5%9b%be%e8%a1%a8%e5%88%bb%e5%ba%a6%e6%a0%87%e7%ad%be/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 15:22:55 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[原创文章]]></category>
		<category><![CDATA[axis]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=113</guid>
		<description><![CDATA[Flex为我们提供了一套非常强大的图表组件，而且这些组件给我们开发人员提供了丰富的接口，在此基础上可以扩展出更加令人兴奋的应用。 下面是我扩展的AxisRenderer类，AxisRenderer是图表轴渲染器，所有图表的轴都是通过这个类来渲染的。而我这个例子所做就是在AxisRenderer的基础上提供几个接口(以Style方式)，这几个接口的作用是给轴的刻度标签加上格式、前/后缀、千位符、单位。 Demo AxisRendererPlus继承自mx.charts.AxisRenderer package org.beasy.charts &#123; import mx.charts.AxisRenderer; import mx.charts.LinearAxis; import mx.charts.chartClasses.IAxisRenderer; import mx.formatters.NumberFormatter; &#160; /** * 是否显示千位符 * * @default false */ &#91;Style&#40;name=&#34;useThousandsSeparator&#34;, type=&#34;Boolean&#34;, inherit=&#34;no&#34;&#41;&#93; &#160; /** * 保留小数点位数 * * @default 0 */ &#91;Style&#40;name=&#34;precision&#34;, type=&#34;int&#34;, format=&#34;Length&#34;, inherit=&#34;no&#34;&#41;&#93; &#160; /** * 前缀 * * @param null */ &#91;Style&#40;name=&#34;prefix&#34;, type=&#34;String&#34;, inherit=&#34;no&#34;&#41;&#93; &#160; /** * [...]]]></description>
			<content:encoded><![CDATA[<p>Flex为我们提供了一套非常强大的图表组件，而且这些组件给我们开发人员提供了丰富的接口，在此基础上可以扩展出更加令人兴奋的应用。<br />
下面是我扩展的AxisRenderer类，AxisRenderer是图表轴渲染器，所有图表的轴都是通过这个类来渲染的。而我这个例子所做就是在AxisRenderer的基础上提供几个接口(以Style方式)，这几个接口的作用是给轴的刻度标签加上格式、前/后缀、千位符、单位。</p>
<p><a href="http://www.beasy.org/wp-content/uploads/2010/01/CustomLinearAxisLabelsFormat1.swf" target="_blank">Demo</a></p>
<p><a href="http://www.beasy.org/wp-content/uploads/2010/01/labelFormat.png"><img src="http://www.beasy.org/wp-content/uploads/2010/01/labelFormat.png" alt="" title="labelFormat" width="526" height="525" class="alignnone size-full wp-image-128" /></a><br />
<span id="more-113"></span></p>
<p>AxisRendererPlus继承自mx.charts.AxisRenderer</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org.beasy.charts
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.charts.AxisRenderer;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.charts.LinearAxis;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.charts.chartClasses.IAxisRenderer;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.formatters.NumberFormatter;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 是否显示千位符
	 * 
	 * @default false
	 */</span>
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;useThousandsSeparator&quot;</span>, <span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;Boolean&quot;</span>, inherit=<span style="color: #990000;">&quot;no&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 保留小数点位数
	 * 
	 * @default 0
	 */</span>	
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;precision&quot;</span>, <span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;int&quot;</span>, format=<span style="color: #990000;">&quot;Length&quot;</span>, inherit=<span style="color: #990000;">&quot;no&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 前缀
	 * 
	 * @param null
	 */</span>	
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;prefix&quot;</span>, <span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;String&quot;</span>, inherit=<span style="color: #990000;">&quot;no&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 后缀
	 * 
	 *@default null 
	 */</span>	
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;suffix&quot;</span>, <span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;String&quot;</span>, inherit=<span style="color: #990000;">&quot;no&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 货币单位
	 * 
	 * @param value
	 */</span>	
	<span style="color: #000000;">&#91;</span>Style<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>=<span style="color: #990000;">&quot;moneyUnit&quot;</span>, <span style="color: #004993;">type</span>=<span style="color: #990000;">&quot;com.beasy.charts.MoneyUnits&quot;</span>, inherit=<span style="color: #990000;">&quot;no&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 扩展过的AxisRendererPlus
	 * 支持定义标签格式:
	 * 1,支持千们符
	 * 2,小数点保留位数
	 * 3,前缀
	 * 4,后缀
	 * 5,大数字单位缩写
	 * 
	 * @author Marco
	 */</span>	
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> AxisRendererPlus extends AxisRenderer
	<span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Constructor</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> AxisRendererPlus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			labelFunction = myLabelFunction;
			numberFmt = <span style="color: #0033ff; font-weight: bold;">new</span> NumberFormatter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Variables</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> numberFmt<span style="color: #000000; font-weight: bold;">:</span>NumberFormatter;
&nbsp;
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Methods</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 * 
		 * 根据设定的样式值在labelFunction中转换显示的标签.
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> myLabelFunction<span style="color: #000000;">&#40;</span>axisRenderer<span style="color: #000000; font-weight: bold;">:</span>IAxisRenderer, label<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> useThousandsSeparator<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #004993;">getStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;useThousandsSeparator&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> precision<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #004993;">getStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;precision&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">prefix</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">getStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;prefix&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> suffix<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">getStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;suffix&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> moneyUnit<span style="color: #000000; font-weight: bold;">:</span>MoneyUnits = <span style="color: #004993;">getStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;moneyUnit&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> axisRenderer.axis <span style="color: #0033ff; font-weight: bold;">is</span> LinearAxis <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> num<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">Number</span><span style="color: #000000;">&#40;</span> label <span style="color: #000000;">&#41;</span>;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> moneyUnit <span style="color: #000000;">&#41;</span>
					num = MoneyUnits.formatByUnit<span style="color: #000000;">&#40;</span>moneyUnit.unit, num<span style="color: #000000;">&#41;</span>;
&nbsp;
				numberFmt.precision = precision;
				numberFmt.useThousandsSeparator = useThousandsSeparator;
				label = numberFmt.format<span style="color: #000000;">&#40;</span>num<span style="color: #000000;">&#41;</span>;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">prefix</span> <span style="color: #000000;">&#41;</span>
					label = <span style="color: #004993;">prefix</span><span style="color: #000000; font-weight: bold;">+</span>label;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> moneyUnit <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> moneyUnit.unit <span style="color: #000000; font-weight: bold;">!</span>= MoneyUnits.<span style="color: #004993;">NONE</span> <span style="color: #000000;">&#41;</span>
					label <span style="color: #000000; font-weight: bold;">+</span>= moneyUnit.label;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> suffix <span style="color: #000000;">&#41;</span>
					label <span style="color: #000000; font-weight: bold;">+</span>= suffix;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> label;
		<span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>单位实体类MoneyUnits.as:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org.beasy.charts
<span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 货币单位对象
	 * 
	 * @author Marco
	 */</span>	
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MoneyUnits
	<span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Class constants</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 原始单位
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static const <span style="color: #004993;">NONE</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;none&quot;</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 百
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static const HUNDRED<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;hundred&quot;</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 千
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static const THOUSAND<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;thousand&quot;</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 万
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static const TEN_THOUSAND<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;TEN_THOUSAND&quot;</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 十万
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static const LAKH<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;lakh&quot;</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 百万
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static const MILLION<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;million&quot;</span>;
&nbsp;
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Constructor</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MoneyUnits<span style="color: #000000;">&#40;</span> label<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">null</span>, unit<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			_label = label;
			_unit = unit;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Properties</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _label<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _unit<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 单位所对应的标签:百,千,万...
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> label<span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_label = <span style="color: #004993;">value</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> label<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _label;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 要转换的单位:HUNDRED，THOUSAND，TEN_THOUSAND...
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> unit<span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_unit = <span style="color: #004993;">value</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> unit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _unit;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 * 
		 * 根据代币单位计算
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> formatByUnit<span style="color: #000000;">&#40;</span> unitStr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>, num<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">switch</span><span style="color: #000000;">&#40;</span> unitStr <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">case</span> MoneyUnits.<span style="color: #004993;">NONE</span> <span style="color: #000000; font-weight: bold;">:</span>
					<span style="color: #0033ff; font-weight: bold;">break</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">case</span> MoneyUnits.HUNDRED <span style="color: #000000; font-weight: bold;">:</span>
					num <span style="color: #000000; font-weight: bold;">/</span>= <span style="color: #000000; font-weight:bold;">100</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">case</span> MoneyUnits.THOUSAND <span style="color: #000000; font-weight: bold;">:</span>
					num <span style="color: #000000; font-weight: bold;">/</span>= <span style="color: #000000; font-weight:bold;">1000</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">case</span> MoneyUnits.TEN_THOUSAND <span style="color: #000000; font-weight: bold;">:</span>
					num <span style="color: #000000; font-weight: bold;">/</span>= <span style="color: #000000; font-weight:bold;">10000</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">case</span> MoneyUnits.LAKH <span style="color: #000000; font-weight: bold;">:</span>
					num <span style="color: #000000; font-weight: bold;">/</span>= <span style="color: #000000; font-weight:bold;">100000</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">case</span> MoneyUnits.MILLION <span style="color: #000000; font-weight: bold;">:</span>
					num <span style="color: #000000; font-weight: bold;">/</span>= <span style="color: #000000; font-weight:bold;">1000000</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">default</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">break</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> num;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>测试页面CustomLinearAxisLabelsFormat.mxml:</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;s:Application</span> 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:charts=<span style="color: #ff0000;">&quot;org.beasy.charts.*&quot;</span></span>
<span style="color: #000000;">			   xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span> minWidth=<span style="color: #ff0000;">&quot;1024&quot;</span> minHeight=<span style="color: #ff0000;">&quot;768&quot;</span> fontSize=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BasicLayout</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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>
		<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.collections.ArrayCollection;</span>
&nbsp;
<span style="color: #000000;">			<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">			public var dataSource:ArrayCollection = new ArrayCollection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span> Country: <span style="color: #ff0000;">&quot;USA&quot;</span>, Gold: <span style="color: #cc66cc;">3500</span>, Silver:<span style="color: #cc66cc;">3900</span>, Bronze: <span style="color: #cc66cc;">2900</span> <span style="color: #66cc66;">&#125;</span>,</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span> Country: <span style="color: #ff0000;">&quot;China&quot;</span>, Gold: <span style="color: #cc66cc;">3200</span>, Silver:<span style="color: #cc66cc;">1700</span>, Bronze: <span style="color: #cc66cc;">1400</span> <span style="color: #66cc66;">&#125;</span>,</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span> Country: <span style="color: #ff0000;">&quot;Russia&quot;</span>, Gold: <span style="color: #cc66cc;">2700</span>, Silver:<span style="color: #cc66cc;">2700</span>, Bronze: <span style="color: #cc66cc;">3800</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<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>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> title=<span style="color: #ff0000;">&quot;图表轴标签自定义格式测试&quot;</span> width=<span style="color: #ff0000;">&quot;500&quot;</span> height=<span style="color: #ff0000;">&quot;500&quot;</span> left=<span style="color: #ff0000;">&quot;20&quot;</span> top=<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:layout</span><span style="color: #7400FF;">&gt;</span><span style="color: #7400FF;">&lt;s:VerticalLayout</span><span style="color: #7400FF;">/&gt;</span><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColumnChart</span> id=<span style="color: #ff0000;">&quot;columnChart&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{dataSource}&quot;</span> showDataTips=<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:verticalAxisRenderers</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;charts:AxisRendererPlus</span> id=<span style="color: #ff0000;">&quot;axisRenderer&quot;</span> fontSize=<span style="color: #ff0000;">&quot;12&quot;</span></span>
<span style="color: #000000;">										 useThousandsSeparator=<span style="color: #ff0000;">&quot;{thousandsSeparator.selected}&quot;</span></span>
<span style="color: #000000;">										 precision=<span style="color: #ff0000;">&quot;{precision.value}&quot;</span></span>
<span style="color: #000000;">										 prefix=<span style="color: #ff0000;">&quot;{prefix.text}&quot;</span></span>
<span style="color: #000000;">										 suffix=<span style="color: #ff0000;">&quot;{suffix.text}&quot;</span></span>
<span style="color: #000000;">										 moneyUnit=<span style="color: #ff0000;">&quot;{moneyUnits.selectedItem}&quot;</span><span style="color: #7400FF;">&gt;</span></span>
					<span style="color: #000000;"><span style="color: #7400FF;">&lt;charts:axis</span><span style="color: #7400FF;">&gt;</span></span>
						<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:LinearAxis</span> id=<span style="color: #ff0000;">&quot;vAxis&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
					<span style="color: #000000;"><span style="color: #7400FF;">&lt;/charts:axis</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;/charts:AxisRendererPlus</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:verticalAxisRenderers</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:horizontalAxis</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CategoryAxis</span> categoryField=<span style="color: #ff0000;">&quot;Country&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:horizontalAxis</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:series</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColumnSeries</span> displayName=<span style="color: #ff0000;">&quot;Gold&quot;</span> yField=<span style="color: #ff0000;">&quot;Gold&quot;</span> verticalAxis=<span style="color: #ff0000;">&quot;{vAxis}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColumnSeries</span> displayName=<span style="color: #ff0000;">&quot;Silver&quot;</span> yField=<span style="color: #ff0000;">&quot;Silver&quot;</span> verticalAxis=<span style="color: #ff0000;">&quot;{vAxis}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColumnSeries</span> displayName=<span style="color: #ff0000;">&quot;Bronze&quot;</span> yField=<span style="color: #ff0000;">&quot;Bronze&quot;</span> verticalAxis=<span style="color: #ff0000;">&quot;{vAxis}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:series</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ColumnChart</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;千位符:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:CheckBox</span> id=<span style="color: #ff0000;">&quot;thousandsSeparator&quot;</span> selected=<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:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;小数点位数:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:NumericStepper</span> id=<span style="color: #ff0000;">&quot;precision&quot;</span> minimum=<span style="color: #ff0000;">&quot;0&quot;</span> maximum=<span style="color: #ff0000;">&quot;2&quot;</span> stepSize=<span style="color: #ff0000;">&quot;1&quot;</span> value=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;前缀:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;prefix&quot;</span> text=<span style="color: #ff0000;">&quot;$&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;后缀:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;suffix&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;单位:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ComboBox</span> id=<span style="color: #ff0000;">&quot;moneyUnits&quot;</span><span style="color: #7400FF;">&gt;</span></span>
					<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Array</span><span style="color: #7400FF;">&gt;</span></span>
						<span style="color: #000000;"><span style="color: #7400FF;">&lt;charts:MoneyUnits</span> label=<span style="color: #ff0000;">&quot;无&quot;</span> unit=<span style="color: #ff0000;">&quot;{MoneyUnits.NONE}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
						<span style="color: #000000;"><span style="color: #7400FF;">&lt;charts:MoneyUnits</span> label=<span style="color: #ff0000;">&quot;百&quot;</span> unit=<span style="color: #ff0000;">&quot;{MoneyUnits.HUNDRED}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
						<span style="color: #000000;"><span style="color: #7400FF;">&lt;charts:MoneyUnits</span> label=<span style="color: #ff0000;">&quot;千&quot;</span> unit=<span style="color: #ff0000;">&quot;{MoneyUnits.THOUSAND}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
						<span style="color: #000000;"><span style="color: #7400FF;">&lt;charts:MoneyUnits</span> label=<span style="color: #ff0000;">&quot;万&quot;</span> unit=<span style="color: #ff0000;">&quot;{MoneyUnits.TEN_THOUSAND}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
						<span style="color: #000000;"><span style="color: #7400FF;">&lt;charts:MoneyUnits</span> label=<span style="color: #ff0000;">&quot;十万&quot;</span> unit=<span style="color: #ff0000;">&quot;{MoneyUnits.LAKH}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
					<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Array</span><span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ComboBox</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Ps: 全部代码请查看: <a onclick="javascript:pageTracker._trackPageview('/outbound/article/code.google.com');" href="http://code.google.com/p/beasy-flex-library/">http://code.google.com/p/beasy-flex-library/</a> 这里包含了本博所有文章源码.<br />
SVN: <a onclick="javascript:pageTracker._trackPageview('/outbound/article/beasy-flex-library.googlecode.com');" href="http://beasy-flex-library.googlecode.com/svn/trunk/">http://beasy-flex-library.googlecode.com/svn/trunk/</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/01/%e8%87%aa%e5%ae%9a%e4%b9%89%e5%9b%be%e8%a1%a8%e5%88%bb%e5%ba%a6%e6%a0%87%e7%ad%be/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>StyleBindingUtils可以绑定样式的工具类</title>
		<link>http://www.beasy.org/2010/01/stylebindingutils%e5%8f%af%e4%bb%a5%e7%bb%91%e5%ae%9a%e6%a0%b7%e5%bc%8f%e7%9a%84%e5%b7%a5%e5%85%b7%e7%b1%bb/</link>
		<comments>http://www.beasy.org/2010/01/stylebindingutils%e5%8f%af%e4%bb%a5%e7%bb%91%e5%ae%9a%e6%a0%b7%e5%bc%8f%e7%9a%84%e5%b7%a5%e5%85%b7%e7%b1%bb/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 13:28:05 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[原创文章]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=92</guid>
		<description><![CDATA[Flex自带的有一个BindingUtils类，可以把两个类的属性绑定起来，但是不能绑定样式(Style)，样式是Flex中常用的特性，看其BindingUtils源码，绑定技术本身是依靠于ChangeWatcher，所以照着BindingUtils写一个可以绑定样式的方法。 StyleBindingUtils: package org.beasy.binding.utils &#123; import mx.binding.utils.ChangeWatcher; import mx.styles.IStyleClient; &#160; /** * Flex的绑定功能为我们的日常提供很多的方便 * 但是Flex只提供了属性的绑定类-&#62;BindingUtils; * 如果要实现绑定控件的Style还要自己用ChangeWatcher去侦听事件 * 有了StyleBindingUtils这一切将变的简单 * StyleBindingUtils封装了ChangeWatcher进行了Style的绑定实现, * 为您的开发提供了更多方便和快捷 * @author Marco */ public class StyleBindingUtils &#123; public function StyleBindingUtils&#40;&#41; &#123; &#125; &#160; public static function bindStyle&#40; site:IStyleClient, prop:String, host:Object, chain:Object, commitOnly:Boolean = false&#41;:ChangeWatcher &#123; var w:ChangeWatcher = ChangeWatcher.watch&#40;host, chain, null, [...]]]></description>
			<content:encoded><![CDATA[<p>Flex自带的有一个BindingUtils类，可以把两个类的属性绑定起来，但是不能绑定样式(Style)，样式是Flex中常用的特性，看其BindingUtils源码，绑定技术本身是依靠于ChangeWatcher，所以照着BindingUtils写一个可以绑定样式的方法。<br />
StyleBindingUtils:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org.beasy.binding.utils
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.binding.utils.ChangeWatcher;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.styles.IStyleClient;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * Flex的绑定功能为我们的日常提供很多的方便
	 * 但是Flex只提供了属性的绑定类-&gt;BindingUtils;
	 * 如果要实现绑定控件的Style还要自己用ChangeWatcher去侦听事件
	 * 有了StyleBindingUtils这一切将变的简单
	 * StyleBindingUtils封装了ChangeWatcher进行了Style的绑定实现,
	 * 为您的开发提供了更多方便和快捷
	 * @author Marco
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> StyleBindingUtils
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> StyleBindingUtils<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> bindStyle<span style="color: #000000;">&#40;</span>
			site<span style="color: #000000; font-weight: bold;">:</span>IStyleClient, prop<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>,
			host<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>, chain<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>,
			commitOnly<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span>ChangeWatcher
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> w<span style="color: #000000; font-weight: bold;">:</span>ChangeWatcher =
				ChangeWatcher.watch<span style="color: #000000;">&#40;</span>host, chain, <span style="color: #0033ff; font-weight: bold;">null</span>, commitOnly<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>w <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> assign<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Function</span> = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
				<span style="color: #000000;">&#123;</span>
					site.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span>prop, w.getValue<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span>
				w.setHandler<span style="color: #000000;">&#40;</span> assign <span style="color: #000000;">&#41;</span>;
				assign<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">return</span> w;
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p><span id="more-92"></span><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;s:Application</span> 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:charts=<span style="color: #ff0000;">&quot;org.beasy.charts.*&quot;</span></span>
<span style="color: #000000;">			   xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span> minWidth=<span style="color: #ff0000;">&quot;1024&quot;</span> minHeight=<span style="color: #ff0000;">&quot;768&quot;</span> fontSize=<span style="color: #ff0000;">&quot;12&quot;</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>
		<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.graphics.SolidColorStroke;</span>
&nbsp;
<span style="color: #000000;">			import org.beasy.binding.utils.StyleBindingUtils;</span>
&nbsp;
<span style="color: #000000;">			/**</span>
<span style="color: #000000;">			 * 定义一个Stroke, 默认颜色为0x333333</span>
<span style="color: #000000;">			 */</span>
<span style="color: #000000;">			private var background:SolidColorStroke = new SolidColorStroke<span style="color: #66cc66;">&#40;</span>0x333333, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">			private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				/**</span>
<span style="color: #000000;">				 * 进行绑定:把container的borderColor样式属性绑定到borderStroke的color属性上</span>
<span style="color: #000000;">				 */</span>
<span style="color: #000000;">				StyleBindingUtils.bindStyle<span style="color: #66cc66;">&#40;</span>container, <span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, background, <span style="color: #ff0000;">&quot;color&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 changeHandler<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				/**</span>
<span style="color: #000000;">				 * 设置borderStroke的color属性</span>
<span style="color: #000000;">				 * 被绑定对象会联运变化</span>
<span style="color: #000000;">				 */</span>
<span style="color: #000000;">				background.color = backgroundColor.selectedColor;</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>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Canvas</span> width=<span style="color: #ff0000;">&quot;200&quot;</span> height=<span style="color: #ff0000;">&quot;200&quot;</span> id=<span style="color: #ff0000;">&quot;container&quot;</span> borderThickness=<span style="color: #ff0000;">&quot;2&quot;</span> borderStyle=<span style="color: #ff0000;">&quot;solid&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ControlBar</span> width=<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:FormItem</span> label=<span style="color: #ff0000;">&quot;背景色:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;backgroundColor&quot;</span> change=<span style="color: #ff0000;">&quot;changeHandler()&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ControlBar</span><span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/01/stylebindingutils%e5%8f%af%e4%bb%a5%e7%bb%91%e5%ae%9a%e6%a0%b7%e5%bc%8f%e7%9a%84%e5%b7%a5%e5%85%b7%e7%b1%bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Squiggly &#8211; Adobe开发的Flash/Flex拼写检查API</title>
		<link>http://www.beasy.org/2010/01/squiggly-adobe%e5%bc%80%e5%8f%91%e7%9a%84flashflex%e6%8b%bc%e5%86%99%e6%a3%80%e6%9f%a5api/</link>
		<comments>http://www.beasy.org/2010/01/squiggly-adobe%e5%bc%80%e5%8f%91%e7%9a%84flashflex%e6%8b%bc%e5%86%99%e6%a3%80%e6%9f%a5api/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 07:52:06 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[精品收藏]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=69</guid>
		<description><![CDATA[今天逛labs看到的一个好东东，目前是2.0版本，Flex3/4都支持。 Squiggly使用起来很简单，在Flex里使用时，只要导入两个SWC:AdobeSpellingEngine.swc,AdobeSpellingUIEx.swc.从命名就可以看出来，两份个swc一个是负责拼写检查的引擎,另一个是负责UI显示. 使用时代码甚至只需要二行: import com.adobe.linguistics.spelling.SpellUI; SpellUI.enableSpelling(textArea, &#8220;usa.zwl&#8221;);//检查拼写 SpellUI.disableSpelling(textArea);//取消检查 其中textArea是一个Flex文本域组件，&#8221;usa.zwl&#8221;是英文语法字典的路径，此文件Squiggly下载包里面有。   Squiggly官方网站:http://labs.adobe.com/technologies/squiggly/]]></description>
			<content:encoded><![CDATA[<p>今天逛labs看到的一个好东东，目前是2.0版本，Flex3/4都支持。<br />
Squiggly使用起来很简单，在Flex里使用时，只要导入两个SWC:AdobeSpellingEngine.swc,AdobeSpellingUIEx.swc.从命名就可以看出来，两份个swc一个是负责拼写检查的引擎,另一个是负责UI显示.<br />
使用时代码甚至只需要二行:</p>
<ul>
<li><span style="color: #0000ff;">import </span>com.adobe.linguistics.spelling.SpellUI;</li>
<li>SpellUI.enableSpelling(textArea, <span style="color: #800000;">&#8220;usa.zwl&#8221;</span>);<em><span style="color: #008000;">//检查拼写</span></em></li>
<li>SpellUI.disableSpelling(textArea);<span style="color: #008000;"><em>//取消检查</em></span></li>
</ul>
<p>其中textArea是一个Flex文本域组件，&#8221;usa.zwl&#8221;是英文语法字典的路径，此文件Squiggly下载包里面有。</p>
<p><a href="http://www.beasy.org/wp-content/uploads/2010/01/spell-check.jpg"><img class="size-full wp-image-70 alignnone" title="spell check" src="http://www.beasy.org/wp-content/uploads/2010/01/spell-check.jpg" alt="spell check" width="325" height="322" /></a> </p>
<p>Squiggly官方网站:<a href="http://labs.adobe.com/technologies/squiggly/">http://labs.adobe.com/technologies/sq</a><a href="http://labs.adobe.com/technologies/squiggly/">uiggly/</a></p>
<p><a href="http://www.beasy.org/wp-content/uploads/2010/01/spell-check.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/01/squiggly-adobe%e5%bc%80%e5%8f%91%e7%9a%84flashflex%e6%8b%bc%e5%86%99%e6%a3%80%e6%9f%a5api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转]Windows 7的“上帝模式”</title>
		<link>http://www.beasy.org/2010/01/%e8%bd%acwindows-7%e7%9a%84%e2%80%9c%e4%b8%8a%e5%b8%9d%e6%a8%a1%e5%bc%8f%e2%80%9d/</link>
		<comments>http://www.beasy.org/2010/01/%e8%bd%acwindows-7%e7%9a%84%e2%80%9c%e4%b8%8a%e5%b8%9d%e6%a8%a1%e5%bc%8f%e2%80%9d/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 02:04:10 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[精品收藏]]></category>
		<category><![CDATA[win7]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=62</guid>
		<description><![CDATA[在Windows7里，上帝能做什么？一个简单的方法就可以调出调整Windows 7系统的全功能控制面板，这一小技巧可以让你从鼠标调整到硬盘分区，启动“上帝模式”非常简单，只要建立一个文件夹，然后将它命名为GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}，上帝就出现了，微软并没有解释GodMode的用途，但它应该类似于游戏秘笈show me the money的作用，去试试看吧。 GodMode.{ED7BA470-8E54-465E-825C-99712043E01C} 本文资源来自:http://www.cnbeta.com/articles/101401.htm]]></description>
			<content:encoded><![CDATA[<p><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px">在Windows7里，上帝能做什么？<br style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px" />一个简单的方法就可以调出调整Windows 7系统的全功能控制面板，这一小技巧可以让你从鼠标调整到硬盘分区，启动“上帝模式”非常简单，只要建立一个文件夹，然后将它命名为GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}，上帝就出现了，微软并没有解释GodMode的用途，但它应该类似于游戏秘笈show me the money的作用，去试试看吧。</span></span></p>
<p style="text-align: center;"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><a href="http://www.beasy.org/wp-content/uploads/2010/01/icon.PNG"><img class="alignnone size-full wp-image-63" title="icon" src="http://www.beasy.org/wp-content/uploads/2010/01/icon.PNG" alt="icon" width="110" height="86" /></a></span></span></p>
<p style="text-align: center;"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: center; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px">GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}</span></span></span></span></p>
<p><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: center; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><a href="http://www.beasy.org/wp-content/uploads/2010/01/god-mode.PNG"><img class="size-full wp-image-64 alignnone" title="god mode" src="http://www.beasy.org/wp-content/uploads/2010/01/god-mode.PNG" alt="god mode" width="622" height="786" /></a></span></span></span></span></span></span></span></span></p>
<p><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: center; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px"><span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Simsun; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: #000000; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="TEXT-ALIGN: left; LINE-HEIGHT: 21px; FONT-FAMILY: Verdana; FONT-SIZE: 14px">本文资源来自:<a href="http://www.cnbeta.com/articles/101401.htm">http://www.cnbeta.com/articles/101401.htm</a></span></span></span></span></span></span></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/01/%e8%bd%acwindows-7%e7%9a%84%e2%80%9c%e4%b8%8a%e5%b8%9d%e6%a8%a1%e5%bc%8f%e2%80%9d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Tree上添加CheckBox(II) &#8211; 支持级联选择</title>
		<link>http://www.beasy.org/2010/01/%e5%9c%a8tree%e4%b8%8a%e6%b7%bb%e5%8a%a0checkbox-ii/</link>
		<comments>http://www.beasy.org/2010/01/%e5%9c%a8tree%e4%b8%8a%e6%b7%bb%e5%8a%a0checkbox-ii/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 07:54:59 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[原创文章]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[tree]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=54</guid>
		<description><![CDATA[以前也写过一遍关于Tree CheckBox ItemRenderer的文章，分析如何在Tree的节点上添加Checkbox，实现了在节点上添加了CheckBox并关联对应数据的selected:Boolean属性，也就是CheckBox的选择状态随selected属性的改变而改变，selected也随时更新当前节点上CheckBox的选择状态。 目前这个版本不仅实现了原有的功能，而且支持了树结构级联选择：支节点选中的话支节点下的子节点也会选中。 效果图: 示例 设计思想：为了保证数据格式的合法性和通用性，要求数据源里的每个数据点都是强类型并且实现IListItemData接口，这样在ItemRenderer内部就可以统一对接口编程，程序也更加OOP。 接口IListItemData: package org.beasy.controls.listClasses &#123; import mx.collections.ArrayCollection; &#160; /** * @author Marco */ public interface IListItemData &#123; /** * 唯一索引 */ function set id&#40; value:String &#41;:void; function get id&#40;&#41;:String; &#160; /** * 显示标签 */ function set label&#40; value:String &#41;:void; function get label&#40;&#41;:String; &#160; /** * 当前项是否选中 */ function set [...]]]></description>
			<content:encoded><![CDATA[<p>以前也写过一遍关于Tree CheckBox ItemRenderer的文章，分析如何在Tree的节点上添加Checkbox，实现了在节点上添加了CheckBox并关联对应数据的selected:Boolean属性，也就是CheckBox的选择状态随selected属性的改变而改变，selected也随时更新当前节点上CheckBox的选择状态。</p>
<p>目前这个版本不仅实现了原有的功能，而且支持了树结构级联选择：支节点选中的话支节点下的子节点也会选中。</p>
<p>效果图:<br />
<a href="http://www.beasy.org/wp-content/uploads/2010/01/TreeCheckBoxItemRenderer.swf" target="_blank"><img class="size-full wp-image-121 alignnone" title="tree checkbox itemRenderer" src="http://www.beasy.org/wp-content/uploads/2010/01/tree-checkbox-itemRenderer.jpg" alt="" width="225" height="422" /></a><br />
<a href="http://www.beasy.org/wp-content/uploads/2010/01/TreeCheckBoxItemRenderer.swf" target="_blank">示例</a><br />
<span id="more-54"></span></p>
<p>设计思想：为了保证数据格式的合法性和通用性，要求数据源里的每个数据点都是强类型并且实现IListItemData接口，这样在ItemRenderer内部就可以统一对接口编程，程序也更加OOP。</p>
<p><strong>接口IListItemData</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org.beasy.controls.listClasses
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.collections.ArrayCollection;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * @author Marco
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> interface IListItemData
	<span style="color: #000000;">&#123;</span>
		<span style="color: #3f5fbf;">/**
		 * 唯一索引
		 */</span>
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> id<span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>;
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> id<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 显示标签
		 */</span>
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> label<span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>;
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> label<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 当前项是否选中
		 */</span>
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> selected<span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>;
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> selected<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 当前荐是否可选
		 */</span>
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">selectable</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>;
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">selectable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 当前子集
		 */</span>
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">children</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span>ArrayCollection <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>;
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">children</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span>ArrayCollection;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 当前项的父级
		 */</span>
		<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">parent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span>IListItemData;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>接口定义了一些最基本的属性其中要主意的属性是parent, parent属性是存放父级数据点的引用，顶级节点为null，这个属性在定义数据源的时候不要忘记赋值，因为级联选择就靠他了。</p>
<p><strong>主类CheckBoxItemRendererPlus:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> org.beasy.controls.treeClasses
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.binding.utils.BindingUtils;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.collections.ArrayCollection;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.CheckBox;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.treeClasses.TreeItemRenderer;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.treeClasses.TreeListData;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.beasy.controls.listClasses.IListItemData;
	<span style="color: #0033ff; font-weight: bold;">import</span> org.beasy.events.ItemRendererEvent;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * 增强的在Tree组件上使用的ItemRenderer
	 * 支持级联选中，反选，数据源同步.
	 *
	 * @author Marco
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CheckBoxTreeRendererPlus extends TreeItemRenderer
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CheckBoxTreeRendererPlus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Variables</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> checkBox<span style="color: #000000; font-weight: bold;">:</span>CheckBox = <span style="color: #0033ff; font-weight: bold;">null</span>;
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _dataDirty<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>;
&nbsp;
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Overridens</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @protected
		 *
		 * 重写父类setter data方法
		 */</span>
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">data</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			_dataDirty = <span style="color: #0033ff; font-weight: bold;">true</span>;
			invalidateProperties<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">super</span>.<span style="color: #004993;">data</span> = <span style="color: #004993;">value</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @protected
		 *
		 * 重写父类的&lt;code&gt;createChildren()&lt;/code&gt;方法
		 * 在此方法内创建checkBox实例.
		 */</span>
		override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> createChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span>.createChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			checkBox = <span style="color: #0033ff; font-weight: bold;">new</span> CheckBox<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			checkBox.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">CHANGE</span>, changeHandler<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> checkBox <span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @protected
		 *
		 * 重写父类的&lt;code&gt;commitProperties()&lt;/code&gt;方法
		 * 在此方法内进行发生绑定.
		 */</span>
		override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> commitProperties<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span>.commitProperties<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> _dataDirty <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				_dataDirty = <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
				<span style="color: #6699cc; font-weight: bold;">var</span> item<span style="color: #000000; font-weight: bold;">:</span>IListItemData = IListItemData<span style="color: #000000;">&#40;</span> <span style="color: #004993;">data</span> <span style="color: #000000;">&#41;</span>;
				BindingUtils.bindProperty<span style="color: #000000;">&#40;</span>checkBox, <span style="color: #990000;">&quot;selected&quot;</span>, item, <span style="color: #990000;">&quot;selected&quot;</span><span style="color: #000000;">&#41;</span>;
				BindingUtils.bindProperty<span style="color: #000000;">&#40;</span>checkBox, <span style="color: #990000;">&quot;enabled&quot;</span>, item, <span style="color: #990000;">&quot;selectable&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @protected
		 *
		 * 重写父类的&lt;code&gt;updateDisplayList()&lt;/code&gt;方法
		 * 重新排列位置, 将label后移
		 */</span>
		override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> updateDisplayList<span style="color: #000000;">&#40;</span>unscaledWidth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>, unscaledHeight<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span>.updateDisplayList<span style="color: #000000;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> startx<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">data</span> <span style="color: #000000; font-weight: bold;">?</span> TreeListData<span style="color: #000000;">&#40;</span> listData <span style="color: #000000;">&#41;</span>.<span style="color: #004993;">indent</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">0</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>disclosureIcon<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				disclosureIcon.<span style="color: #004993;">x</span> = startx;
&nbsp;
				startx = disclosureIcon.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">+</span> disclosureIcon.<span style="color: #004993;">width</span>;
&nbsp;
				disclosureIcon.setActualSize<span style="color: #000000;">&#40;</span>disclosureIcon.<span style="color: #004993;">width</span>,
					disclosureIcon.<span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span>;
&nbsp;
				disclosureIcon.<span style="color: #004993;">visible</span> = <span style="color: #004993;">data</span> <span style="color: #000000; font-weight: bold;">?</span>
					TreeListData<span style="color: #000000;">&#40;</span> listData <span style="color: #000000;">&#41;</span>.hasChildren <span style="color: #000000; font-weight: bold;">:</span>
					<span style="color: #0033ff; font-weight: bold;">false</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>icon<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				icon.<span style="color: #004993;">x</span> = startx;
				startx = icon.<span style="color: #004993;">x</span> <span style="color: #000000; font-weight: bold;">+</span> icon.measuredWidth;
				icon.setActualSize<span style="color: #000000;">&#40;</span>icon.measuredWidth, icon.measuredHeight<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> checkBox <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				checkBox.move<span style="color: #000000;">&#40;</span>startx, <span style="color: #000000;">&#40;</span> unscaledHeight <span style="color: #000000; font-weight: bold;">-</span> checkBox.<span style="color: #004993;">height</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000;">&#41;</span>;
				label.<span style="color: #004993;">x</span> = startx <span style="color: #000000; font-weight: bold;">+</span> checkBox.getExplicitOrMeasuredWidth<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//  Methodes</span>
		<span style="color: #009900;">//</span>
		<span style="color: #009900;">//--------------------------------------------------------------------------</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * @private
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> changeHandler<span style="color: #000000;">&#40;</span> event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			IListItemData<span style="color: #000000;">&#40;</span><span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span>.selected = checkBox.selected;
			<span style="color: #6699cc; font-weight: bold;">var</span> item<span style="color: #000000; font-weight: bold;">:</span>IListItemData = IListItemData<span style="color: #000000;">&#40;</span> <span style="color: #004993;">data</span> <span style="color: #000000;">&#41;</span>;
			checkChildren<span style="color: #000000;">&#40;</span>item<span style="color: #000000;">&#41;</span>;
			checkPreLevel<span style="color: #000000;">&#40;</span>item<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> evt<span style="color: #000000; font-weight: bold;">:</span>ItemRendererEvent;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight: bold;">!</span>item.<span style="color: #004993;">children</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; item.id <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				evt = <span style="color: #0033ff; font-weight: bold;">new</span> ItemRendererEvent<span style="color: #000000;">&#40;</span> ItemRendererEvent.TREE_ITEM_CLICK, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
				evt.item = item;
				evt.itemRenderer = <span style="color: #0033ff; font-weight: bold;">this</span>;
				<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span> evt <span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> item.<span style="color: #004993;">children</span> <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> collection<span style="color: #000000; font-weight: bold;">:</span>ArrayCollection = <span style="color: #0033ff; font-weight: bold;">new</span> ArrayCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				getDescendant<span style="color: #000000;">&#40;</span>item, collection<span style="color: #000000;">&#41;</span>;
				evt = <span style="color: #0033ff; font-weight: bold;">new</span> ItemRendererEvent<span style="color: #000000;">&#40;</span> ItemRendererEvent.TREE_FOLDER_CLICK, <span style="color: #0033ff; font-weight: bold;">true</span> <span style="color: #000000;">&#41;</span>;
				evt.<span style="color: #004993;">children</span> = collection;
				evt.itemRenderer = <span style="color: #0033ff; font-weight: bold;">this</span>;
				<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span> evt <span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> getDescendant<span style="color: #000000;">&#40;</span> item<span style="color: #000000; font-weight: bold;">:</span>IListItemData, collection<span style="color: #000000; font-weight: bold;">:</span>ArrayCollection <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> node<span style="color: #000000; font-weight: bold;">:</span>IListItemData <span style="color: #0033ff; font-weight: bold;">in</span> item.<span style="color: #004993;">children</span> <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> node.<span style="color: #004993;">children</span> <span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					getDescendant<span style="color: #000000;">&#40;</span>node, collection<span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span>
				<span style="color: #0033ff; font-weight: bold;">else</span>
				<span style="color: #000000;">&#123;</span>
					collection.addItem<span style="color: #000000;">&#40;</span> node <span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 递归算法，循环遍历所有子集
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> checkChildren<span style="color: #000000;">&#40;</span>item<span style="color: #000000; font-weight: bold;">:</span>IListItemData<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> node<span style="color: #000000; font-weight: bold;">:</span>IListItemData <span style="color: #0033ff; font-weight: bold;">in</span> item.<span style="color: #004993;">children</span> <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>node.selected <span style="color: #000000; font-weight: bold;">!</span>= item.selected<span style="color: #000000;">&#41;</span>
					node.selected = item.selected;
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> node.<span style="color: #004993;">children</span> <span style="color: #000000;">&#41;</span>
					checkChildren<span style="color: #000000;">&#40;</span> node <span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #3f5fbf;">/**
		 * 递归当前项父级
		 */</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> checkPreLevel<span style="color: #000000;">&#40;</span>item<span style="color: #000000; font-weight: bold;">:</span>IListItemData<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight: bold;">!</span>item.<span style="color: #004993;">parent</span> <span style="color: #000000;">&#41;</span>
				<span style="color: #0033ff; font-weight: bold;">return</span>;
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> flag<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> node<span style="color: #000000; font-weight: bold;">:</span>IListItemData <span style="color: #0033ff; font-weight: bold;">in</span> item.<span style="color: #004993;">parent</span>.<span style="color: #004993;">children</span> <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight: bold;">!</span>node.selected <span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					flag = <span style="color: #0033ff; font-weight: bold;">false</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> item.<span style="color: #004993;">parent</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; flag <span style="color: #000000; font-weight: bold;">!</span>= item.<span style="color: #004993;">parent</span>.selected <span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				item.<span style="color: #004993;">parent</span>.selected = flag;
				checkPreLevel<span style="color: #000000;">&#40;</span> item.<span style="color: #004993;">parent</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>测试页面:</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;s:Application</span> 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;">			   minWidth=<span style="color: #ff0000;">&quot;1024&quot;</span> minHeight=<span style="color: #ff0000;">&quot;768&quot;</span> 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;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.collections.ArrayCollection;</span>
&nbsp;
<span style="color: #000000;">			import org.beasy.controls.listClasses.IListItemData;</span>
<span style="color: #000000;">			import org.beasy.controls.treeClasses.BasicTreeItemData;</span>
&nbsp;
&nbsp;
<span style="color: #000000;">			private var collection:ArrayCollection;</span>
&nbsp;
<span style="color: #000000;">			private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				initDatas<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">				tree.dataProvider = collection;</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">			/**</span>
<span style="color: #000000;">			 * 转换数据</span>
<span style="color: #000000;">			 */</span>
<span style="color: #000000;">			private function initDatas<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				collection = new ArrayCollection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">				var xmlList:XMLList = dataSource.node;</span>
<span style="color: #000000;">				convertData<span style="color: #66cc66;">&#40;</span> xmlList, collection, null <span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">				return true;</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">			/**</span>
<span style="color: #000000;">			 * 将xml格式数据转换为ArrayCollection.</span>
<span style="color: #000000;">			 */</span>
<span style="color: #000000;">			private function convertData<span style="color: #66cc66;">&#40;</span> xmlList:XMLList, collection:ArrayCollection, parent:IListItemData<span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				for each<span style="color: #66cc66;">&#40;</span> var node:XML in xmlList <span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					var children:XMLList = node.elements<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;node&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">					var item:IListItemData = new BasicTreeItemData<span style="color: #66cc66;">&#40;</span>parent<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">					item.label = node.@label;</span>
<span style="color: #000000;">					if<span style="color: #66cc66;">&#40;</span> children.length<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #7400FF;">&gt;</span></span> 0 )
					{
						var childCollection:ArrayCollection = new ArrayCollection();
						convertData(children, childCollection, item);
						item.children = childCollection;
					}
					collection.addItem( item );
				}
			}
&nbsp;
		]]&gt;
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XML</span> id=<span style="color: #ff0000;">&quot;dataSource&quot;</span><span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;">&lt;root<span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;中国&quot;</span><span style="color: #7400FF;">&gt;</span></span>
					<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;上海&quot;</span><span style="color: #7400FF;">&gt;</span></span>
						<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;静安区&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
						<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;黄浦区&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
						<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;浦东区&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
					<span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
					<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;北京&quot;</span><span style="color: #7400FF;">&gt;</span></span>
						<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;海淀区&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
						<span style="color: #000000;">&lt;node label=<span style="color: #ff0000;">&quot;朝阳区&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
					<span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
				<span style="color: #000000;">&lt;/node<span style="color: #7400FF;">&gt;</span></span>
			<span style="color: #000000;">&lt;/root<span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XML</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Tree</span> id=<span style="color: #ff0000;">&quot;tree&quot;</span> width=<span style="color: #ff0000;">&quot;200&quot;</span> height=<span style="color: #ff0000;">&quot;400&quot;</span> x=<span style="color: #ff0000;">&quot;20&quot;</span> y=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">			 itemRenderer=<span style="color: #ff0000;">&quot;org.beasy.controls.treeClasses.CheckBoxTreeRendererPlus&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>全部代码请查看: <a href="http://code.google.com/p/beasy-flex-library/">http://code.google.com/p/beasy-flex-library/</a> 这里包含了本博所有文章源码.<br />
SVN: <a href="http://beasy-flex-library.googlecode.com/svn/trunk/">http://beasy-flex-library.googlecode.com/svn/trunk/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2010/01/%e5%9c%a8tree%e4%b8%8a%e6%b7%bb%e5%8a%a0checkbox-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>同事推荐的一个Javascript开源图表组件</title>
		<link>http://www.beasy.org/2009/12/%e5%90%8c%e4%ba%8b%e6%8e%a8%e8%8d%90%e7%9a%84%e4%b8%80%e4%b8%aajavascript%e5%bc%80%e6%ba%90%e5%9b%be%e8%a1%a8%e7%bb%84%e4%bb%b6/</link>
		<comments>http://www.beasy.org/2009/12/%e5%90%8c%e4%ba%8b%e6%8e%a8%e8%8d%90%e7%9a%84%e4%b8%80%e4%b8%aajavascript%e5%bc%80%e6%ba%90%e5%9b%be%e8%a1%a8%e7%bb%84%e4%bb%b6/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 10:37:19 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[精品收藏]]></category>

		<guid isPermaLink="false">http://www.beasy.org/?p=49</guid>
		<description><![CDATA[今天同事推荐给我一个Javascript开源图表站点highcharts,又被震撼了一次，每天都被震撼中。。。 咋一看还以为是flash做的呢，看上去感觉很舒服，图表线形很圆滑，而且还带阴影。 粗略看一下她目前貌似支持AreaChar, BarChart, ColumnChart, LineChart, PieChart 五种主流图表，而且还支持图表混合, Legend(图例联想)，标签旋转等常用功能 。 更重要的是她的帮助文档很全面，并且附带了很多demo源码。]]></description>
			<content:encoded><![CDATA[<p>今天同事推荐给我一个Javascript开源图表站点<a href="http://www.highcharts.com" target="_blank">highcharts</a>,又被震撼了一次，每天都被震撼中。。。</p>
<p>咋一看还以为是flash做的呢，看上去感觉很舒服，图表线形很圆滑，而且还带阴影。</p>
<p>粗略看一下她目前貌似支持AreaChar, BarChart, ColumnChart, LineChart, PieChart 五种主流图表，而且还支持图表混合, Legend(图例联想)，标签旋转等常用功能 。</p>
<p><a href="http://www.beasy.org/wp-content/uploads/2009/12/highcharts.png"><img class="alignnone size-full wp-image-50" title="highcharts" src="http://www.beasy.org/wp-content/uploads/2009/12/highcharts.png" alt="highcharts" width="722" height="358" /></a></p>
<p>更重要的是她的帮助文档很全面，并且附带了很多demo源码。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beasy.org/2009/12/%e5%90%8c%e4%ba%8b%e6%8e%a8%e8%8d%90%e7%9a%84%e4%b8%80%e4%b8%aajavascript%e5%bc%80%e6%ba%90%e5%9b%be%e8%a1%a8%e7%bb%84%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
