<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex实例</title>
	<atom:link href="http://www.flexrain.cn/feed" rel="self" type="application/rss+xml" />
	<link>http://www.flexrain.cn</link>
	<description>Flex AS3 and Flash</description>
	<lastBuildDate>Thu, 25 Feb 2010 00:35:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flex Label组件扩展边框与背景</title>
		<link>http://www.flexrain.cn/flex/flex-label-border.html</link>
		<comments>http://www.flexrain.cn/flex/flex-label-border.html#comments</comments>
		<pubDate>Wed, 24 Feb 2010 07:12:03 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Label]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=613</guid>
		<description><![CDATA[
效果预览:




由于Label控件没有borderStyle属性,也就是它不支持边框与背景图.所以我们可以通过扩展Label控件来实现边框与背景图!其他不支持边框或者背景的控件如:Text、Image用同样方法可以扩展它。下面运用到自定义Flex控件的[Style]元素标签。
下表描述了[Style]元数据标签的属性：

table { 
width: 728px; 
padding: 0; 
margin: 0;
border-left: 1px solid #C1DAD7; 
}
th { 
font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
color: #4f6b72; 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
border-top: 1px solid #C1DAD7; 
letter-spacing: 2px; 
text-transform: uppercase; 
text-align: center; 
padding: 6px 6px 6px 12px; 
background: #CAE8EA  no-repeat; 
} 
td { 
border-right: [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/flex-label-border.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flex 让控件闪烁</title>
		<link>http://www.flexrain.cn/flex/flex-glowfilter.html</link>
		<comments>http://www.flexrain.cn/flex/flex-glowfilter.html#comments</comments>
		<pubDate>Thu, 11 Feb 2010 04:47:39 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=609</guid>
		<description><![CDATA[
效果预览:




看到天地会论坛有个让Flex里的控件闪烁效果,在那大侠的基础上稍稍加了几个参数进去,效果还挺好的~:)
ControlEffect.mxml
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application&#160;xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; initialize=&#34;init()&#34; backgroundColor=&#34;0x000000&#34;&#62;
&#60;mx:Script&#62;
&#160; &#160; &#60;![CDATA[
&#160; &#160; &#160; &#160; import&#160;com.tween.GlowTween;
&#160; &#160; &#160; &#160; private&#160;function init():void
&#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; //对象,颜色,BlurX, BlurY, 内外发光
&#160; &#160; &#160; &#160; &#160; &#160; new&#160;GlowTween(img1,0xFFFF00, 2, 10);
&#160; &#160; &#160; &#160; &#160; &#160; new&#160;GlowTween(img2, 0xFF0000, 10, 20, true);
&#160; &#160; &#160; &#160; &#160; &#160; new&#160;GlowTween(btn, 0x0000FF, 0, [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/flex-glowfilter.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Flex 自定义组件自定义属性的动态更新</title>
		<link>http://www.flexrain.cn/flex/flex-dynamic-attr.html</link>
		<comments>http://www.flexrain.cn/flex/flex-dynamic-attr.html#comments</comments>
		<pubDate>Wed, 10 Feb 2010 11:50:29 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=601</guid>
		<description><![CDATA[
效果预览:




前天有群友问到在Flex里自定义了一个组件,然后又在该组件里public了一个属性绑定数据不更新问题,然后在主程的mxml里声明命名空间后,用标签形式把自定义的属生用{}绑定一个字符变量可以实时更新,但由AS生成的自定义组件的属性就不能实时更新.经过乱翻一些资料可以用BindingUtils类的bindProperty方法实现由AS生成的组件自定义属性更新!当按提交时,会同时更新两个组件的flag属性值
参数:
bindProperty(site:Object, prop:String, host:Object, chain:Object, commitOnly:Boolean = false)
其实我们这样用:
bindProperty(目标对象, 目标对象属性, 数据源对象, 数据源对象属性)
DynamicAttr.mxml
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application&#160;xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; initialize=&#34;init()&#34; xmlns:Jian=&#34;*&#34;&#62;
&#60;mx:Script&#62;
&#60;![CDATA[
&#160; &#160; import&#160;mx.binding.utils.BindingUtils;
&#160; &#160; 
&#160; &#160; [Bindable]
&#160; &#160; public&#160;var attr:String = Math.random().toString();
&#160; &#160; 
&#160; &#160; private&#160;function init():void
&#160; &#160; {
&#160; &#160; &#160; var&#160;temp:LabelExt = new LabelExt();
&#160; &#160; &#160; temp.x = 150;
&#160; &#160; &#160; temp.y = 50;
&#160; &#160; &#160; temp.setStyle(&#34;borderStyle&#34;, &#34;solid&#34;);
&#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/flex-dynamic-attr.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>M8 官方新UI v9.6.9正式版</title>
		<link>http://www.flexrain.cn/flex/m8-ui-v9-6-9.html</link>
		<comments>http://www.flexrain.cn/flex/m8-ui-v9-6-9.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:49:51 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Order]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=596</guid>
		<description><![CDATA[&#160;&#160;
&#160;

&#160;&#160;
&#160;

&#160;&#160;
&#160;

&#160;&#160;
&#160;

&#160;&#160;
&#160;

&#160;&#160;
&#160;

&#160;&#160;
]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/m8-ui-v9-6-9.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex XML的属性排序</title>
		<link>http://www.flexrain.cn/flex/flex-xml-attribute-sort.html</link>
		<comments>http://www.flexrain.cn/flex/flex-xml-attribute-sort.html#comments</comments>
		<pubDate>Tue, 02 Feb 2010 08:12:12 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=593</guid>
		<description><![CDATA[
效果预览:




经过一番研究搞定了,这方法的效率不怎么样,望高人指点!,如:其中id与type是employee的属性值,实现原理是将XML的属性值取出来存为数组,然后按你想要的排序去重排那个数组,再循环条件将XML的属性值与数组排序后的值对比,重新赋给新的XML或者XMLList.
xmlSort.mxml
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application&#160;xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;horizontal&#34; creationComplete=&#34;init()&#34;&#62;
&#160; &#160; &#60;mx:Script&#62;
&#160; &#160; &#160; &#160; &#60;![CDATA[
&#160; &#160; &#160; &#160; &#160; &#160; import&#160;mx.events.DropdownEvent;
&#160; &#160; &#160; &#160; &#160; &#160; 
&#160; &#160; &#160; &#160; &#160; &#160; [Bindable]
&#160; &#160; &#160; &#160; &#160; &#160; public&#160;var dataXML:XMLList;
&#160; &#160; &#160; &#160; &#160; &#160; private&#160;function init():void
&#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/flex-xml-attribute-sort.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>AS3 atan与atan2函数区别</title>
		<link>http://www.flexrain.cn/flex/as3-atan-atan2.html</link>
		<comments>http://www.flexrain.cn/flex/as3-atan-atan2.html#comments</comments>
		<pubDate>Sat, 30 Jan 2010 04:45:45 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[MTM]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=584</guid>
		<description><![CDATA[
效果预览:




AS3里,反正切atan2函数比反正切atan函数(即角的对边比邻边)更为有用,它可以让我们做出对物体正确的旋转.请记住Flash里的y轴坐标与数学的是颠倒的.(上面演示所示),Flash是以弧度来计算的!坐标上的刻度值位置不太准,没校对大家就大概移到相应的点的位置上就可以验证下面的列表值
atan(val:Number)     atan2(y:Number,x:Number)
弧度角度换算公式:
弧度转为角度
degree = radians * 180 / PI
角度转为弧度
radians = degree * PI / 180
当用atan函数时(注意是近似值):[弧度\度]
Math.atan(1/2)≈0.4636476090008061≈26.56505117707799°
Math.atan(-1/2)≈-0.4636476090008061≈-26.56505117707799°
Math.atan(-1/-2)≈0.4636476090008061≈26.56505117707799°
Math.atan(1/-2)≈-0.4636476090008061≈-26.56505117707799°
当用atan2函数时(注意是近似值):[弧度\度]
Math.atan2(1,2)≈0.4636476090008061≈26.56505117707799°
Math.atan2(-1,2)≈-0.4636476090008061≈-26.56505117707799°
Math.atan2(-1,-2)≈-2.677945044588987≈-153.43494882292202°
Math.atan2(1,-2)≈2.677945044588987≈153.43494882292202°
]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/as3-atan-atan2.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flex与 JS 交互通信方法</title>
		<link>http://www.flexrain.cn/flex/flex-to-js.html</link>
		<comments>http://www.flexrain.cn/flex/flex-to-js.html#comments</comments>
		<pubDate>Tue, 26 Jan 2010 17:32:42 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=568</guid>
		<description><![CDATA[
效果预览:




Request Flex:
&#160;&#160;
vbox1vbox2vbox3
&#160;&#160;


说白了就是AS调用JS的函数和JS调用AS的函数!
AS调用JS:
主要用AS中的ExternalInterface.call(&#8221;toIE&#8221;, txt.text);第一个参数是JS中的函数名,第二个就是附带参数过去也可以不带参数)
JS调用AS函数
它比AS调用JS要复杂些,主要是JS代码要先判断浏览器再找出SWF然后再调用AS中的方法.用ExternalInterface.addCallback(&#8221;reset&#8221;, resetVBox);第一个参数是JS中的函数,第二个就是AS中的函数,即是JS中执行了reset函数也就是等于执行了AS中resetVBox函数;
心得:这样意味着要是大家结合jQuery会设计出更强大的交互功能来!!还有JS和AS互调的函数不要同名,不然会失效!还有在用ExternalInterface.call与ExternalInterface.addCallback时请先判断浏览器是否可用:if(ExternalInterface.available){} 这样可以因不是在浏览器里运行SWF而点击AS调用JS时出错!
HTML代码 注:因为我用了JQ框架,如果不懂可以替换alert演示
&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html&#160;xmlns=&#34;http://www.w3.org/1999/xhtml&#34; lang=&#34;UTF-8&#34;&#62;
&#60;meta&#160;http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34; /&#62;
&#60;meta&#160;http-equiv=&#34;Content-Language&#34; content=&#34;UTF-8&#34; /&#62;
&#160;&#60;head&#62;
&#160; &#60;title&#62; Flex Show &#60;/title&#62;
&#160; &#60;script&#160;src=&#34;js/swfobject.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
&#160; &#60;script&#160;src=&#34;js/jquery-1.3.2.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
&#160; &#60;script&#160;type=&#34;text/javascript&#34;&#62;&#60;!--
&#160; &#160; function findSWF(movieName) {&#160; &#160; 
&#160; &#160; &#160; &#160; if (navigator.appName.indexOf(&#34;Microsoft&#34;)!= -1) {&#160; &#160; 
&#160; &#160; &#160; &#160; &#160; &#160; return window[movieName];&#160; &#160; 
&#160; &#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/flex-to-js.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Open-Flash-Chart (lug wyrm) Line类型精彩Demo</title>
		<link>http://www.flexrain.cn/flex/open-flash-chart-lug-wyrm-line-demo.html</link>
		<comments>http://www.flexrain.cn/flex/open-flash-chart-lug-wyrm-line-demo.html#comments</comments>
		<pubDate>Mon, 25 Jan 2010 06:55:37 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[ofc]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=561</guid>
		<description><![CDATA[
Demo演示请点击图:

继前天发布的Bar Demo后,顺便把常用的Line Chart也研究一下!这次顺利得多,有了制作Bar Demo的经验,进行的很顺利,就是add新数据时,要用到JQ的live来委派事件!
PHP后台处理中用$_POST方法,这样可以提交更多的数据!估计PHP处理数据代码这么密密麻麻,没人会去看的,不过原理也简单,主要是获取表单提交来的值后,分别处理给OFC的PHP类包方法作为参数.UI界面下了点功夫,研究了一天多,辛苦呀
data1.php
&#60;?php
//获取表单数据
$f_title = empty($_POST['title'])?'上年业绩走势':$_POST['title'];
$f_style = empty($_POST['tstyle'])?'{font-size: 15px; color: #778877; text-align: center;}':$_POST['tstyle'];
$f_bgcolor = empty($_POST['bgcolor'])?'#FFFFFF':$_POST['bgcolor'];
$f_3d = empty($_POST['3d'])?0:$_POST['3d'];
$f_formatval = empty($_POST['formatval'])?array(0,true,true,true):split(&#34;,&#34;,$_POST['formatval']);
//x轴相关
$f_xcolor = empty($_POST['xcolor'])?'#DAD5E0':$_POST['xcolor'];
$f_xstep = empty($_POST['xstep'])?1:(int)$_POST['xstep'];
$f_xaxiscolor = empty($_POST['xaxiscolor'])?'#0099FF':$_POST['xaxiscolor'];
$f_xoffset = empty($_POST['xoffset'])?true:false;
$f_xlegend = empty($_POST['xlegend'])?'':$_POST['xlegend'];
$f_xlegendstyle = empty($_POST['xlegendstyle'])?'':$_POST['xlegendstyle'];
$f_xstroke = empty($_POST['xstroke'])?1:(int)$_POST['xstroke'];
$f_xtickheight = empty($_POST['xtickheight'])?1:(int)$_POST['xtickheight'];
$f_xfontcolor = empty($_POST['xfontcolor'])?'#000000':$_POST['xfontcolor'];
$f_xfontsize = empty($_POST['xfontsize'])?12:(int)$_POST['xfontsize'];
//y轴相关
$f_ycolor = empty($_POST['ycolor'])?'#DAD5E0':$_POST['ycolor'];
$f_yaxiscolor = empty($_POST['yaxiscolor'])?'#9ABD2E':$_POST['yaxiscolor'];
$f_ystroke = empty($_POST['ystroke'])?2:(int)$_POST['ystroke'];
$f_yticklength = empty($_POST['yticklength'])?2:(int)$_POST['yticklength'];
$f_ymax = empty($_POST['ymax'])?0:(int)$_POST['ymax'];
$f_ymin = empty($_POST['ymin'])?0:(int)$_POST['ymin'];
$f_ystep = empty($_POST['ystep'])?500:(int)$_POST['ystep'];
$f_ylegend = empty($_POST['ylegend'])?'':$_POST['ylegend'];
$f_ylegendstyle [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/open-flash-chart-lug-wyrm-line-demo.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open-Flash-Chart (lug wyrm) Bar类型精彩Demo</title>
		<link>http://www.flexrain.cn/flex/open-flash-chart-lug-wyrm-bar-demo.html</link>
		<comments>http://www.flexrain.cn/flex/open-flash-chart-lug-wyrm-bar-demo.html#comments</comments>
		<pubDate>Sat, 23 Jan 2010 09:58:20 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[ofc]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=554</guid>
		<description><![CDATA[
Demo演示请点击图:

研究了一天的Demo,新版本的OFC带来了过渡动画,效果好看多了!因为是结合了JQ与OFC的PHP类包来写AJAX,在过制作过程中,遇到不少麻烦.也谢谢JQ高手TGL的帮助指导!
    问题一:用OFC的PHP类包传中文时,IE与FF出现不兼容,中文x标签名在FF下正常,IE6就乱码了
   解决:用encodeURIComponent函数编码后再发送!
   问题二:同样传十六进制颜色值时,OFC的PHP类包接收有问题,如:有个变量值是&#8217;#FFFFFF&#8217;,用$.getJSON传参数过去后,PHP类包后台处理不了!
   解决:后来在用replace(&#8221;#&#8221;,&#8221;)替换掉#号就传过去了.这虽然不是好办法,大家有好办法请留言指正.
    问题三:JQ选择器的问题$(&#8221;.vals:not(:first)&#8221;)在IE与FF下获取的对象长度不一样!这也让我觉得很奇怪,以前制作时还可以的.
    解决:用$(&#8221;.vals&#8221;).not(&#8221;:first&#8221;)兼容了IE与FF.
    问题四:JQ插件颜色colorSelector.js不兼容,IE下用该插件显示十六进制,但在FF下显示RGB.
    解决:在colorSelector.js插件里加入以下代码,不兼容了IE与FF.
FF.js
if(temp.indexOf(&#34;rgb&#34;)!=-1)
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/open-flash-chart-lug-wyrm-bar-demo.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>《Making Things Move》第5章速度与加速-学习笔记</title>
		<link>http://www.flexrain.cn/flex/making-things-move-5.html</link>
		<comments>http://www.flexrain.cn/flex/making-things-move-5.html#comments</comments>
		<pubDate>Tue, 05 Jan 2010 13:22:31 +0000</pubDate>
		<dc:creator>阿健PHPer</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ofc]]></category>

		<guid isPermaLink="false">http://www.flexrain.cn/?p=540</guid>
		<description><![CDATA[
请按方向键 回车可重置(由于浏览器按向上时会滚动,源代码在最下面Ship.as与ShipSim.as)




请按方向键进行加速，回车可重置(源码在下面Acceleration2.as)




速度的定义：特定方向上的速率。向量是有大小和方向的一个东西。向量是以箭头形式绘制下面给出一个轴上的速度，下面给出演示一个轴上的速度：只要在x轴累加值，当是负值是我们可以看成是向从右向左边移动，反之亦然。注意Circle类扩展canvas容器。
一个轴上的速度效果预览:




Circle.as
package&#160;
{
&#160; &#160; import&#160;mx.containers.Canvas;
&#160; &#160; 
&#160; &#160; public&#160;class Circle extends Canvas
&#160; &#160; {
&#160; &#160; &#160; &#160; override&#160;protected function updateDisplayList(unscaleWidth:Number, unscaleHeight:Number):void
&#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; super.updateDisplayList(unscaleWidth, unscaleHeight);
&#160; &#160; &#160; &#160; &#160; &#160; if&#160;(graphics)
&#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; graphics.clear();
&#160; &#160; &#160; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://www.flexrain.cn/flex/making-things-move-5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
