<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[海蓝博客]]></title> 
<link>http://www.ldsea.cn/index.php</link> 
<description><![CDATA[Stick To Learning]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[海蓝博客]]></copyright>
<item>
<link>http://www.ldsea.cn/post/315/</link>
<title><![CDATA[【转】合格程序员每天每周每月每年应该做的事]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Mon, 22 Mar 2010 14:20:01 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/315/</guid> 
<description>
<![CDATA[ 
	<p><strong>程序员每天该做的事</strong></p>&nbsp;&nbsp;<p>1、总结自己一天任务的完成情况 最好的方式是写工作日志，把自己今天完成了什么事情，遇见了什么问题都记录下来，日后翻看好处多多</p>&nbsp;&nbsp;<p>2、考虑自己明天应该做的主要工作 把明天要做的事情列出来，并按照优先级排列，第二天应该把自己效率最高的时间分配给最重要的工作</p>&nbsp;&nbsp;<p>3、考虑自己一天工作中失误的地方，并想出避免下一次再犯的方法 出错不要紧，最重要的是不要重复犯相同的错误，那是愚蠢</p>&nbsp;&nbsp;<p>4、考虑自己一天工作完成的质量和效率能否还能提高 一天只提高1%，365天你的效率就能提高多少倍你知道吗？ (1+0.01)^365 = 37 倍</p>&nbsp;&nbsp;<p>5、看一个有用的新闻网站或读一张有用的报纸，了解业界动态 闭门造车是不行的，了解一下别人都在做什么，对自己能带来很多启示</p>&nbsp;&nbsp;<p>6、记住一位同事的名字及其特点 你认识公司的所有同事吗？你了解他们吗？</p>&nbsp;&nbsp;<p>7、清理自己的代码 今天完成的代码，把中间的调试信息，测试代码清理掉，按照编码风格整理好，注释都写好了吗？</p>&nbsp;&nbsp;<p>8、清理自己的桌面 当日事当日毕，保持清洁干劲的桌面才能让你工作时不分心，程序员特别要把电脑的桌面清理干净</p>&nbsp;&nbsp;<p><strong>程序员每周该做的事</strong></p>&nbsp;&nbsp;<p>1、向你的老板汇报一次工作 让你的老板知道你在做什么，这很重要。可以口头、书面、邮件，看你老板的工作方式而定</p>&nbsp;&nbsp;<p>2、进行一次自我总结（非正式） 这周之内自己表现得怎么样？该加分还是扣分？</p>&nbsp;&nbsp;<p>3、制定下周计划 把下周要做的事情列出来，一样要分清楚优先级</p>&nbsp;&nbsp;<p>4、整理自己的文件夹、书柜和电脑文件 把桌面以外的地方也要清理干净，电脑的文件夹，收到的邮件，把过时的垃圾全部清理掉</p>&nbsp;&nbsp;<p>5、与一个非公司的朋友沟通 它山之石，可以攻玉</p>&nbsp;&nbsp;<p>6、看一本杂志 找一本适合自己的专业杂志、</p>&nbsp;&nbsp;<p>7、纠正自己或同事一个细节上的不正确做法 《细节决定成败》看过了吗？没看过强烈建议先看看</p>&nbsp;&nbsp;<p><strong>程序员每月该做的事</strong></p>&nbsp;&nbsp;<p>1、至少和一个同事一起吃饭或喝茶 不光了解自己工作伙伴的工作，还要了解他们的生活</p>&nbsp;&nbsp;<p>2、自我考核一次 相对正式地考核自己一下，你对得起这个月的工资吗？</p>&nbsp;&nbsp;<p>3、对你的同事考核一次 你的同事表现怎么样？哪些人值得学习，哪些人需要帮助？</p>&nbsp;&nbsp;<p>3、制定下月的计划，确定下月的工作重点</p>&nbsp;&nbsp;<p>4、总结自己工作质量改进状况 自己的质量提高了多少？</p>&nbsp;&nbsp;<p>5、有针对性地对一项工作指标做深入地分析并得出改进的方案 可以是对自己的，也可以是对公司的，一定要深入地分析后拿出自己的观点来。要想在老板面前说得上话，做的成事，工作上功夫要做足。</p>&nbsp;&nbsp;<p>6、与老板沟通一次 最好是面对面地沟通，好好表现一下自己，虚心听取老板的意见，更重要的是要了解老板当前关心的重点</p>&nbsp;&nbsp;<p><strong>程序员每年该做的事</strong></p>&nbsp;&nbsp;<p>1、年终总结 每个公司都会做的事情，但你真正认真地总结过自己吗？</p>&nbsp;&nbsp;<p>2、兑现给自己、给家人的承诺 给老婆、儿子的新年礼物买了没有？给自己的呢？</p>&nbsp;&nbsp;<p>3、下年度工作规划 好好想想自己明年的发展目标，争取升职/加薪、跳槽还是自己出来干？</p>&nbsp;&nbsp;<p>4、掌握一项新技术 至少是一项，作为程序员一年要是一项新技术都学不到手，那就一定会被淘汰。 掌握可不是看本书就行的，要真正懂得应用，最好你能够写一篇教程发表到你的blog</p>&nbsp;&nbsp;<p>5、推出一种新产品 可以是一个真正的产品，也可以只是一个类库，只要是你创造的东西就行，让别人使用它，也为世界作点贡献。当然如果真的很有价值，收点注册费也是应该的</p>&nbsp;&nbsp;<p>6、与父母团聚一次 常回家看看，常回家看看</p>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/c-print-lingxing/</link>
<title><![CDATA[用C语言打印一个菱形-公式法]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Fri, 05 Mar 2010 04:43:17 +0000</pubDate> 
<guid>http://www.ldsea.cn/c-print-lingxing/</guid> 
<description>
<![CDATA[ 
	<span style="border-collapse: separate; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-family: Arial,Helvetica,sans-serif,宋体; color: #000000" class="Apple-style-span"><span style="font-size: 20px; line-height: 30px; font-family: 黑体; color: #444444" class="Apple-style-span">今天和我<a href="http://t.sina.com.cn/ldsea" target="_blank">新浪微博</a>的一位好友<a href="http://t.sina.com.cn/1678315037" target="_blank">Misacat</a>聊起了C语言，用C语言打印一个菱形，今天上午抽空写了写，好久没有写C语言，竟生疏了很多...<br />其实这些打印类的问题，都能用一个固定的方法来做，我把它叫做&ldquo;公式法&rdquo;，打印类的题目都可归结为在一个平面打印一个图形，这个图形由星号组号。再进一步说，无非就是两种情况，打印一个空格，或者打印一个星号。不同的打印空格和星号的规则不同，就打印成了不同的图形。说到这里就更好理解了，一个平面图形是由什么构成的？就是纵坐标和横坐标，将它们定义为两个变量，i和j.这样任何的打印问题都可以由两个for循环来做<br /><span class="codes">for(int i=0;i&lt;M;i++)&#123;//这个是扫描i即纵坐标，就构成了一条线<br />&nbsp;&nbsp; for(int j=0;j&lt;N;j++)&#123;//这个是在定了一个i的情况下，再扫描横坐标，<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //这样就构成了一个面<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; method()&#123;&#125;:<br />&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br />&#125;</span>那个method()方法其实在定义了一个i即横坐标之后，相应的纵坐标的规则，一般的打印都是有规则的，有了i，一定有个相应的规则来求出j。不会有人无聊到打印一个毫无规律的东东吧。即一定可以写出 j = getJMethod(i);这样的一个方法。<br />有了j=getJMethod(i);的方法就好办了，在内层循环里一个一个匹配吧，如果符合j=getJMethod(i)的，就打印一个星号，如果不符合，就打印一个空格。如下所示：<br /><span class="codes">for(int i=0;i&lt;M;i++)&#123;//这个是扫描i即综坐标，就构成了一条线<br />&nbsp;&nbsp; for(int j=0;j&lt;N;j++)&#123;//这个是在定了一个i的情况下，再扫描横坐标，<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //这样就构成了一个面<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; method()&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(j==getJMethod(i)) print(&quot;*&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else print(&quot; &quot;;)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;print(&quot;&#92;n&quot;);//打印完一整行后，别忘了打印一个换行符。&nbsp;&nbsp;&nbsp;&nbsp;<br />&#125;</span>下面我们就可以套用这个公式来完成这个题目了，完整C语言代码如下，相信聪明的你一定可以读懂的:)<br /><span class="codes">#include &lt;stdio.h&gt;<br /><br />int main()<br />&#123;<br />&nbsp;&nbsp;int i;<br />&nbsp;&nbsp;int j;<br />&nbsp;&nbsp;for(i=1;i&lt;=7;i++)<br />&nbsp;&nbsp;&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp; if(i&lt;=4)&#123;//前4行<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(j=1;j&lt;=7;j++)&#123;//打印每一行的星号或者空格 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int temp=i-1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *找规律，i=1时，即第一行，是第4个位置星号，其他地方空格<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *第二行，是4，5，6三个位置星号，其他地方空格<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *第三行，是2，3，4，5，6五个位置星号，其他地方空格<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *所以j应该满足，j&gt;=(4-(i-1))并且j&lt;=(4+(i-1))时是星号，其他空格 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(j&gt;=4-temp&amp;&amp;j&lt;=4+temp) printf(&quot;*&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else printf(&quot; &quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /**打印完以后有回车*/ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;&#92;n&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp; &#125; <br />&nbsp;&nbsp;&nbsp;&nbsp; else //后三行<br />&nbsp;&nbsp;&nbsp;&nbsp; &#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(j=1;j&lt;=7;j++)&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int temp=7-i;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 找规律，i=5时，即第五行，是第3，4，5个位置星号，其他地方空格<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第二行，是4，5，6三个位置星号，其他地方空格<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第三行，是2，3，4，5，6五个位置星号，其他地方空格<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 所以j应该满足，j&gt;=(4-(i-1))并且j&lt;=(4+(i-1))时是星号，其他空格 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(j&gt;=4-temp&amp;&amp;j&lt;=4+temp) printf(&quot;*&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else printf(&quot; &quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;&#92;n&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp; &#125;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&#125;<br />&nbsp;&nbsp;system(&quot;PAUSE&quot;);&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;return 0;<br />&#125;</span>打印完的界面如下：<br /><img src="attachment/201003/1267763306_83304f42.jpg" border="0" /><br />这时一定有朋友说了，&ldquo;这个太复杂了，打印菱形我有更好的办法，比这个简洁多了&rdquo;，没错，你说的是对的。我只是抽象出了一种公共的方法，以后无论任何打印的问题，都是可以这么做的，可谓是个万能方法。<br />我之前写过一篇&ldquo;<a href="java_PrintCircle/" target="_blank">用java打印一个圆</a>&rdquo;，用的就是这个方法。<br />好了，希望我这个公式法可以对你有所帮助:-)<br /></span></span>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/279/</link>
<title><![CDATA[【转】C++ builder 家用摄像头捕捉图像]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Thu, 17 Sep 2009 11:16:18 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/279/</guid> 
<description>
<![CDATA[ 
	我们来开发一个用家用摄像头捕捉图像的小程序。程序的主要代码如下，其中步骤说明将插入到代码当中。<br/><br/>步骤一：<br/><br/>在C++ builder中新建的Form上插入：2个button，一个panel，一个ComboBox和一个SaveDialg<br/><br/>步骤二：编写代码<br/><div class="code"><br/>//----------------------------------------------------------------------------<br/>#include &lt;vcl.h&gt;<br/>#pragma hdrstop<br/><br/>#include &quot;Unit1.h&quot;<br/>#include &quot;vfw.h&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //双击Form后，在代码区先加入vfw头文件。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>//----------------------------------------------------------------------------<br/>#pragma resource &quot;*.dfm&quot;<br/>#pragma package(smart_init)<br/>TForm1 *Form1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//加入自定义变量。<br/>HWND hWndC;<br/>CAPDRIVERCAPS CapDrvCaps;<br/>CAPSTATUS CapStatus;<br/>//----------------------------------------------------------------------------<br/>__fastcall TForm1::TForm1(TComponent *Owner)<br/> : TForm(Owner)<br/>&#123;<br/>&#125;<br/>//----------------------------------------------------------------------------<br/>void __fastcall TForm1::FormCreate(TObject *Sender)<br/>&#123;<br/> Table1-&gt;Open();<br/>&#125;<br/>//----------------------------------------------------------------------------<br/>void __fastcall TForm1::Button1Click(TObject *Sender)&nbsp;&nbsp;&nbsp;&nbsp;// 加入启动camere的程序。<br/>&#123;<br/>&nbsp;&nbsp;char szDeviceName&#91;80&#93;;<br/>&nbsp;&nbsp;char szDeviceVersion&#91;80&#93;;<br/>&nbsp;&nbsp;for (int wIndex=0;wIndex&lt;10;wIndex++)<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;if (capGetDriverDescription(wIndex,szDeviceName,sizeof(szDeviceName),szDeviceVersion,sizeof(szDeviceVersion)))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Camera-&gt;Items-&gt;Add(szDeviceName);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;if(Camera-&gt;Items-&gt;Count&gt;0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Camera-&gt;ItemIndex=0;<br/>&nbsp;&nbsp;&nbsp;&nbsp;else<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage(&quot;There is no camera!&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Close();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/><br/> //检查视频是否处于实时捕获状态<br/>&nbsp;&nbsp;if(CapStatus.fLiveWindow==1)<br/>&nbsp;&nbsp;//CapStatus.fLiveWindow=1表明当前初频已处于实时捕获状态，否则CapStatus.fLiveWindow=0<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ShowMessage(&quot;You needn&#039;t do it again！&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;return;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;hWndC=capCreateCaptureWindow((LPSTR)&quot;My Capture Window&quot;,WS_CHILD &#124; WS_VISIBLE,0,0,160,120,(HWND)Panel2-&gt;Handle,Camera-&gt;ItemIndex+1);<br/>&nbsp;&nbsp;//连接设备：<br/>&nbsp;&nbsp;capDriverConnect(hWndC,0);<br/>&nbsp;&nbsp;capPreviewRate(hWndC,50); // rate, in milliseconds<br/>&nbsp;&nbsp;capPreview(hWndC,TRUE); // starts preview<br/>&nbsp;&nbsp;//获取视频驱动相关性能<br/>&nbsp;&nbsp;capDriverGetCaps(hWndC,&amp;CapDrvCaps,sizeof(CAPDRIVERCAPS));<br/>&nbsp;&nbsp;//获取捕获窗口状态<br/>&nbsp;&nbsp;capGetStatus(hWndC,&amp;CapStatus,sizeof(CAPSTATUS));<br/>&nbsp;&nbsp;SetWindowPos(hWndC,NULL,0,0,CapStatus.uiImageWidth,CapStatus.uiImageHeight,SWP_NOZORDER &#124; SWP_NOMOVE);<br/>&#125;<br/>//---------------------------------------------------------------------------<br/><br/>void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)<br/>&#123;<br/>&nbsp;&nbsp; if(hWndC)<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;capPreview(hWndC,FALSE);<br/>&nbsp;&nbsp;&nbsp;&nbsp;capDriverDisconnect(hWndC);<br/>&nbsp;&nbsp;&#125;<br/><br/>&#125;<br/>//---------------------------------------------------------------------------<br/><br/>void __fastcall TForm1::Button2Click(TObject *Sender)&nbsp;&nbsp;&nbsp;&nbsp;//加入图像保存程序。<br/>&#123;<br/>if(SavePictureDialog1-&gt;Execute())<br/>capFileSaveDIB(hWndC,(SavePictureDialog1-&gt;FileName+&quot;.bmp&quot;).c_str());<br/>&#125;<br/>//---------------------------------------------------------------------------<br/> <br/></div><br/>步骤三：<br/><br/>运行并测试。<br/>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/278/</link>
<title><![CDATA[用AutoIt写了一个图片自动归档软件]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Mon, 14 Sep 2009 02:40:37 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/278/</guid> 
<description>
<![CDATA[ 
	<span style="font-size: 14px;">在内网论坛看到有人发帖说需要一个照片自动归档的软件，就是把图片可以按照图片的日期放到相应的文件夹中，感觉用AutoIt这种软件应该挺好实现的，就写了一个，代码如下</span><br/><div class="code"><br/>#include &lt;GUIConstantsEx.au3&gt;<br/>#include &lt;WindowsConstants.au3&gt;<br/><br/>Opt(&#039;MustDeclareVars&#039;, 1)<br/><br/>AutoPhoto()<br/><br/>Func AutoPhoto()<br/>&nbsp;&nbsp;&nbsp;&nbsp;Local $font,$msg,$Button_1,$radio1,$radio2,$radio3,$radio4,$isOldPhoto,$isCreatDate<br/>&nbsp;&nbsp;$isOldPhoto=True;<br/>&nbsp;&nbsp;$isCreatDate=True;<br/>&nbsp;&nbsp;&nbsp;&nbsp;GUICreate(&quot;图片自动归档程序V1.1--Made By 蓝色天空&quot;,500,200) ; will create a dialog box that when displayed is centered<br/>&nbsp;&nbsp;&nbsp;&nbsp;GUISetState(@SW_SHOW) ; will display an empty dialog box<br/>&nbsp;&nbsp;GUICtrlCreateLabel(&quot;这是一个图片自动归档程序，请把该软件放到图片的同一目录下。&quot;, -1, 10) ; next line<br/>&nbsp;&nbsp;GUICtrlCreateLabel(&quot;选择是否保留原图片和归档日期的方式后，点击按钮后图片即可自动归档&quot;, -1, 30) ; next line<br/>&nbsp;&nbsp;$radio1 = GUICtrlCreateRadio(&quot;保留原图片&quot;, 10, 60, 100, 20)<br/>&nbsp;&nbsp;&nbsp;&nbsp;$radio2 = GUICtrlCreateRadio(&quot;不保留原图片&quot;, 150, 60, 100, 20)<br/>&nbsp;&nbsp;GUIStartGroup()<br/>&nbsp;&nbsp;&nbsp;&nbsp;GUICtrlSetState($radio1, $GUI_CHECKED)<br/>&nbsp;&nbsp;$radio3 = GUICtrlCreateRadio(&quot;按创建日期归档&quot;, 10, 80, 100, 20)<br/>&nbsp;&nbsp;&nbsp;&nbsp;$radio4 = GUICtrlCreateRadio(&quot;按修改日期归档&quot;, 150, 80, 100, 20)<br/>&nbsp;&nbsp;GUIStartGroup()<br/>&nbsp;&nbsp;GUICtrlSetState($radio3, $GUI_CHECKED)<br/>&nbsp;&nbsp;$Button_1 = GUICtrlCreateButton(&quot;开始自动归档&quot;, 10, 120, 100)<br/>&nbsp;&nbsp;&nbsp;&nbsp;; Run the GUI until the dialog is closed&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;While 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$msg = GUIGetMsg()<br/>&nbsp;&nbsp;&nbsp;&nbsp;Select<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case $msg = $GUI_EVENT_CLOSE<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExitLoop<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$isOldPhoto=True;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$isOldPhoto=False;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case $msg = $radio3 And BitAND(GUICtrlRead($radio3), $GUI_CHECKED) = $GUI_CHECKED<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$isCreatDate=True;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case $msg = $radio4 And BitAND(GUICtrlRead($radio4), $GUI_CHECKED) = $GUI_CHECKED<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$isCreatDate=False;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case $msg = $Button_1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doAutoPhoto($isOldPhoto,$isCreatDate); Will Run/Open Notepad<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EndSelect<br/>&nbsp;&nbsp;&nbsp;&nbsp;WEnd<br/>&nbsp;&nbsp;&nbsp;&nbsp;GUIDelete()<br/>EndFunc&nbsp;&nbsp; ;==&gt;Example1<br/><br/><br/>Func doAutoPhoto($isOldPhoto,$isCreatDate)<br/>&nbsp;&nbsp;Local $search,$file,$t,$yyyymd<br/>&nbsp;&nbsp;; 显示当前目录中所有文件的文件名<br/>$search = FileFindFirstFile(&quot;*.jpg&quot;)<br/><br/>; 检查搜索是否成功<br/>If $search = -1 Then<br/>&nbsp;&nbsp;MsgBox(0, &quot;错误&quot;, &quot;该目录下已经没有jpg图片文件&quot;)<br/>&nbsp;&nbsp;Exit<br/>EndIf<br/><br/>While 1<br/>&nbsp;&nbsp;$file = FileFindNextFile($search)<br/>&nbsp;&nbsp;If $isCreatDate=True Then<br/>&nbsp;&nbsp;$t = FileGetTime($file, 1)<br/>&nbsp;&nbsp;EndIf<br/>&nbsp;&nbsp;If $isCreatDate=False Then<br/>&nbsp;&nbsp;$t = FileGetTime($file, 0)<br/>&nbsp;&nbsp;EndIf<br/>&nbsp;&nbsp;If Not @error Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;$yyyymd = $t&#91;0&#93; &amp; &quot;年&quot; &amp; $t&#91;1&#93; &amp; &quot;月&quot; &amp; $t&#91;2&#93; &amp; &quot;日&quot;<br/>&nbsp;&nbsp;&nbsp;&nbsp;;MsgBox(0, $file+&quot;的创建日期:&quot;, $yyyymd)<br/>&nbsp;&nbsp;&nbsp;&nbsp;If $isOldPhoto=True Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;FileCopy($file, @ScriptDir &amp; &quot;&#92;&quot; &amp; $yyyymd &amp; &quot;&#92;&quot;, 8)<br/>&nbsp;&nbsp;&nbsp;&nbsp;EndIf<br/>&nbsp;&nbsp;&nbsp;&nbsp;If $isOldPhoto=False Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;FileMove($file, @ScriptDir &amp; &quot;&#92;&quot; &amp; $yyyymd &amp; &quot;&#92;&quot;, 8)<br/>&nbsp;&nbsp;&nbsp;&nbsp;EndIf<br/>&nbsp;&nbsp;&nbsp;&nbsp;;MsgBox(4096, &quot;文件:&quot;, @ScriptDir &amp; &quot;&#92;&quot; &amp; $yyyymd &amp; &quot;&#92;&quot;)<br/>&nbsp;&nbsp;EndIf<br/>&nbsp;&nbsp;If @error Then ExitLoop<br/>&nbsp;&nbsp;;MsgBox(4096, &quot;文件:&quot;, $file)<br/>WEnd<br/>FileClose($search)<br/>MsgBox(64, &quot;海蓝&quot;, &quot;恭喜,所有图片归档完毕&quot;)<br/>EndFunc<br/></div><br/><span style="font-size: 14px;">使用时将这个软件和你需要整理的图片放到同一个目录下，然后点击那个“开始自动归档”按钮，选择是否保留原图片，以及是按创建日期归档，还是按修改日期归档。然后点击下面的按钮就好了</span><br/><a href="http://www.ldsea.cn/attachment.php?fid=189" target="_blank"><img src="http://www.ldsea.cn/attachment.php?fid=189" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><span style="font-size: 14px;">原先目录下有4张图片</span><br/><a href="http://www.ldsea.cn/attachment.php?fid=190" target="_blank"><img src="http://www.ldsea.cn/attachment.php?fid=190" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><span style="font-size: 14px;">当运行程序后，会变为如下的样子，会按照日期进行归档</span><br/><a href="http://www.ldsea.cn/attachment.php?fid=191" target="_blank"><img src="http://www.ldsea.cn/attachment.php?fid=191" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>下载地址：<br/><a href="http://ldsea.cn/soft/autoPhoto.rar">点击这里下载文件</a><br/>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/270/</link>
<title><![CDATA[Flex跨域数据调用crossdomain ]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Fri, 31 Jul 2009 01:18:53 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/270/</guid> 
<description>
<![CDATA[ 
	需要在根目录下放置一个crossdomain.xml文件，表面允许其他的地方的Flash可以访问本站的资源<br/><div class="code"><br/> &lt;?xml version=&quot;1.0&quot;?&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/> &lt;!DOCTYPE cross-domain-policy&nbsp;&nbsp;SYSTEM &quot;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp;<br/> &lt;cross-domain-policy&gt;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp; &lt;allow-access-from domain=&quot;*&quot; /&gt;&nbsp;&nbsp;&nbsp;&nbsp;<br/> &lt;/cross-domain-policy&gt;&nbsp;&nbsp;<br/></div><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/cpl/</link>
<title><![CDATA[CPL文件]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Mon, 04 Aug 2008 14:39:18 +0000</pubDate> 
<guid>http://www.ldsea.cn/cpl/</guid> 
<description>
<![CDATA[ 
	转载自：http://hi.baidu.com/tylzyoudi/blog/item/b75030014e3610031c958369.html控制面板，你了解多少。当你安装了一些应用程序后，是否感觉到你的控制面板增加了一些组件，如安装了Borland C++ Builder后,“BDE Administrator”就会进入你的控制面板，安装了QuickTime还会增加“QuickTime”组件，这些现象说明了什么，我想它只是说明了一个事实：“控制面板”是可以操纵的，你也可以控制你的控制面板，它并无什么神秘可言，哪到底如何操纵呢,这正是我今天要讨论的主题，在这里我将会带领大家有浅入深地来探讨“控制面板”这个鲜为人知的主题。我主要分3个部分来阐述：（由于文章大小的限制，我决定将其分成两章来介绍）<br/>............<br/><br/>Tags - <a href="http://www.ldsea.cn/tags/cpl/" rel="tag">cpl</a> , <a href="http://www.ldsea.cn/tags/%25E6%258E%25A7%25E5%2588%25B6%25E9%259D%25A2%25E6%259D%25BF/" rel="tag">控制面板</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/161/</link>
<title><![CDATA[Flex瘦身的问题]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Sat, 05 Jul 2008 16:00:49 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/161/</guid> 
<description>
<![CDATA[ 
	<p>今天在网上找到用利用RSL给Flex瘦身的方法，发布后确实体积小了很多，由300K减少到100K，我自己看没有问题，可是后来才知道别人如果看的话要首先下载RSL，如下图<br /><img class="insertimage" src="attachment.php?fid=143" border="0" width="274" height="167" /><br />貌似是下载出错了...<br />后来改成普通的Release方式了，300K，还可以接受，现在别人都可以看到了，这个才是目的:)</p><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a> , <a href="http://www.ldsea.cn/tags/rsl/" rel="tag">rsl</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/160/</link>
<title><![CDATA[海蓝s Mini Message BoxV0.1]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Fri, 04 Jul 2008 19:11:10 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/160/</guid> 
<description>
<![CDATA[ 
	<p><span style="font-size: x-large; font-family: verdana,geneva">用Flex做个一个留言本,在博客公告栏的位置,欢迎大家在这里给我留言:)<br /></span></p><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a> , <a href="http://www.ldsea.cn/tags/%25E7%2595%2599%25E8%25A8%2580%25E6%259C%25AC/" rel="tag">留言本</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/156/</link>
<title><![CDATA[五分钟搞定Flex+PHP+MYSQL【转载】]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Tue, 01 Jul 2008 05:17:40 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/156/</guid> 
<description>
<![CDATA[ 
	<div>转自：<a href="http://www.k-zone.cn/zblog/post/log-2007-10-01-Flex-Builder-3-data.html">http://www.k-zone.cn/zblog/post/log-2007-10-01-Flex-Builder-3-data.html</a><br />Adobe Flex&trade; 3 beta 2的新功能之一：增强的Create Application from DataBase</div><div>在Flex3.0 B1的时候增加有过一个功能：可以在Flex自身操作数据库（包括：增加/修改/删除等操作）而新版的Adobe Flex&trade; 3 beta 2将这个功能加强了一些。</div><div>现在就让<a href="http://www.k-zone.cn/">Kenshin</a>来说明一下，如果在PHP+MYSQL5.0的环境下直接使用Flex对数据库进行操作的例子。</div><div>很简单，不需要太复杂的操作就可以完成(*^__^*) 尤其是适合没有使用过PHP+MYSQL5.0的新手（Kenshin也算哦(*^__^*) ）<br />操作步骤：</div><div>1、安装PHP+MYSQL5.0<br />PHP+MYSQL5.0的配置本来就是一件非常麻烦的事情（尤其是对没有接触过PHP+Mysql5.0的朋友而言）</div><div>不过现在有个比较&ldquo;快捷&rdquo;的方式-使用集成PHP+MYSQL5.0环境。我们使用的工具是：APMServ 5.2.0</div><div>下载地址：<a id="87" href="http://apmserv.s135.com/blogger/view_blog.php?BlogID=372599&amp;CategoryID=351008&amp;idWriter=0&amp;Key=0"><span style="color: #551a8b">http://apmserv.s135.com/blogger/view_blog.php?BlogID=372599&amp;CategoryID=351008&amp;idWriter=0&amp;Key=0</span></a></div><div>下载完后（由于是绿色软件），把它解压缩到任意目录下面。例如：I:&#92;APMServ5.2.0</div><div>2、使用APMServ5.2.0</div><div>我们点击&ldquo;启动APMSer&rdquo;这个Button。稍等片刻后即可启动完成，如下图所示：<br /></div><div><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser1.jpg" border="0" width="520" height="365" /></div><div>我们在点击&ldquo;管理MySql5.0&rdquo;这个Button，在弹出的浏览器里面输入默认的用户名和密码（用户名：root 密码：为空）</div><div>在PHPMyAdmin中我们建立一些数据库和表（相信这步操作大家都应该会吧(*^__^*) ）</div><div>例如Kenshin新建的数据库和表。数据库：flexvote 表：db_vote</div><div>这样一来我们就完成了PHP+MYSQL5.0的配置工作。</div><div>别忘了PHP的路径，例如：&#123;你解压缩后APMServ5.2.0的路径&#125;&#92;APMServ5.2.0&#92;www&#92;htdocs<br /></div><div>3、建议一个Flex Project</div><div>我们打开Flex Builder 3.0 B2，然后点击File&rarr;New&rarr;Flex Project，在Project Name中输入：testPHP，在Application service type中选择：PHP</div><div>如下图所示：</div><div><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser2.jpg" border="0" width="520" height="468" /></div><div><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser3.jpg" border="0" width="520" height="468" /></div><div>最后点击Finish即可完成Flex Project的建立(*^__^*)</div><div>4、在Flex Builder中选择Data&rarr;Create Application from Database&rarr;在弹出的对话框中选择New&rarr;在弹出的对话框中填入flexvote（Description可以不用填写）&rarr;</div><div>在弹出的对话框中按下图的方式填写：</div><div><img src="http://www.k-zone.cn/zblog/upload/apmser4.jpg" border="0" width="441" height="381" /></div><div>然后点击Finish即可完成操作。</div><div>在下图中按如下填写：</div><div><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser3.jpg" border="0" width="520" height="468" /></div><div><img src="http://www.k-zone.cn/zblog/upload/apmser4.jpg" border="0" width="441" height="381" /><br />注：其中database Name必须填写（不填写的话Flex Builder 3.0 B2也没有错误的提示，但是最终运行的时候会出现error：no operation的错误信息！）</div><div><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser5.jpg" border="0" width="520" height="338" /></div><div><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser6.jpg" border="0" width="520" height="338" /></div><div><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser7.jpg" border="0" width="520" height="190" /></div><div>最后点击Finish。<br /><br />然后运行我们刚刚建立的db_vote.mxml文件即可。<br /><img style="width: 520px; cursor: pointer" src="http://www.k-zone.cn/zblog/upload/apmser8.jpg" border="0" width="520" height="358" /></div><div>是不是很简单哦(*^__^*)</div><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/155/</link>
<title><![CDATA[Flex与HTPPService，Flex与php的交互]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Tue, 01 Jul 2008 05:04:33 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/155/</guid> 
<description>
<![CDATA[ 
	<br/><div class="code">//-----------------website.mxml--------------------------------------------------------<br/><br/>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/>&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; width=&quot;264&quot; height=&quot;228&quot; &gt;<br/>&lt;mx:scrīpt source=&quot;website.as&quot; /&gt;<br/>&lt;mx:HTTPService id=&quot;checklogin&quot; url=&quot;http://localhost/flex.php&quot; method=&quot;post&quot; result=&quot;loginResult(event)&quot; fault=&quot;err(event)&quot; /&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:TextInput x=&quot;52&quot; y=&quot;55&quot;/&gt;<br/>&lt;mx:Button x=&quot;95&quot; y=&quot;85&quot; label=&quot;login&quot; id=&quot;login&quot; click=&quot;initApp()&quot; /&gt;<br/><br/>&lt;/mx:Application&gt;<br/><br/><br/><br/>//----------website.as脚本内容-------------------------------------------------------<br/><br/>import mx.rpc.events.ResultEvent;//<br/>import mx.rpc.events.FaultEvent;<br/>import mx.controls.Alert;<br/><br/>//点击login按钮时候响应的事件：调用id为checklogin的httpservice的send函数发送post请求给flex.php <br/>public function initApp():void <br/>&#123;<br/>checklogin.send();<br/>&#125;<br/><br/>//通过一个对话框显示post请求返回来的结果。 <br/>public function loginResult(evt:ResultEvent):void<br/>&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;Alert.show(&quot;result: &quot;+evt.result.toString()); <br/>&#125;<br/><br/><br/>//通过一个对话框显示post请求出错后返回来的结果。<br/>public function err(evt:FaultEvent):void<br/>&#123;<br/>&nbsp;&nbsp; Alert.show(&quot;error: &quot;+evt.fault.toString()); <br/>&#125;<br/><br/>//flex.php:写点代码随便输出一句话就可以了。<br/><br/><br/><br/>//比较简单，主要用来明白怎么在flex中使用httpservice来与php交互</div><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a> , <a href="http://www.ldsea.cn/tags/php/" rel="tag">php</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/147/</link>
<title><![CDATA[校内AIR版APP工具源码下载]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Sat, 28 Jun 2008 16:46:55 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/147/</guid> 
<description>
<![CDATA[ 
	<a href="http://ldsea.cn/flex/xiaonei/XNApiTool-src.rar">点击这里下载文件</a><br/><br/>我学习AS3不到1个月,只是了解点皮毛,源码里有关XML的处理我遇到了问题,之前都是有效的,前一阵校内更新后,返回的XML数据发生了变化,我用之前的方法无法正确进行解析,我猜测的原因有两个<br/>一.校内返回的XML数据是非标准的XML格式(这种可能性不是很大)<br/>二.AS3不能处理所有的XML格式？<br/><br/><div class="code">&lt;friends_getFriends_response list=&quot;true&quot; xsi:schemaLocation=&quot;http://api.xiaonei.com/1.0/ http://api.xiaonei.com/1.0/xiaonei.xsd&quot; xmlns=&quot;http://api.xiaonei.com/1.0/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;<br/>&nbsp;&nbsp;&lt;friend&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;id&gt;64238946&lt;/id&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;李正华&lt;/name&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;headurl&gt;http://hd15.xiaonei.com/photos/hd15/20080607/14/27/head_3586g107.jpg&lt;/headurl&gt;<br/>&nbsp;&nbsp;&lt;/friend&gt;<br/>&nbsp;&nbsp;&lt;friend&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;id&gt;229954215&lt;/id&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;郭云超&lt;/name&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;headurl&gt;http://hd34.xiaonei.com/photos/hd34/20080330/22/16/head_1427e169.jpg&lt;/headurl&gt;<br/>&nbsp;&nbsp;&lt;/friend&gt;<br/>&nbsp;&nbsp;&lt;friend&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;id&gt;238684033&lt;/id&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;吴博&lt;/name&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;headurl&gt;http://hd43.xiaonei.com/photos/hd43/20080509/23/04/head_3488d107.jpg&lt;/headurl&gt;<br/>&nbsp;&nbsp;&lt;/friend&gt;<br/>&nbsp;&nbsp;&lt;friend&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;id&gt;238935464&lt;/id&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;李骁?ROMA&lt;/name&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;headurl&gt;http://hd15.xiaonei.com/photos/hd15/20080616/00/05/head_8241m169.jpg&lt;/headurl&gt;<br/>&nbsp;&nbsp;&lt;/friend&gt;<br/>&nbsp;&nbsp;&lt;friend&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;id&gt;239796833&lt;/id&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;刘洋&lt;/name&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;headurl&gt;http://hd13.xiaonei.com/photos/hd13/20080127/13/31/head_1857l107.jpg&lt;/headurl&gt;<br/>&nbsp;&nbsp;&lt;/friend&gt;<br/>&nbsp;&nbsp;&lt;friend&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;id&gt;239972528&lt;/id&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;可臣&lt;/name&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;headurl&gt;http://hd34.xiaonei.com/photos/hd34/20080502/11/59/head_1989a169.jpg&lt;/headurl&gt;<br/>&nbsp;&nbsp;&lt;/friend&gt;<br/>&lt;/friends_getFriends_response&gt;</div><br/>以上代码是返回的XML数据,用之前的AS3的解析方法现在怎么也解析不了...原因不清楚....<br/>希望下载了源码的朋友如果可以正确处理之后，请告诉我解决办法，十分感谢！<br/><br/>我知道<a href="http://awflasher.com/blog" target="_blank">AW兄</a>是AS的高手,期待得到你的答复:)<br/><br/>之前下载过这个工具的朋友应该知道，它主要实现了3个工具，第一是登陆之后得到个人头像和最新的一个状态(这个已经失效，校内关闭了xiaonei.widsets.getHomeInfo接口)，第二个是发布日志(这个也已经失效，校内关闭了xiaonei.blog.addBlog接口)，第三个是得到所有好友，并选择一个好友留言(这个没有失效,这个接口还存在，不过取消了之前有的page和count两个参数，下午的聚会和李福松得到确认，校内会直接返回所有好友信息。但是问题正如我上面提到的，我用之前的方法无法解析这段返回的xml数据...请求大家的帮助..)<br/><br/> <br/><br/>---------------------------------------------------<br/><br/>btw: 非常感谢AW组织了今天的聚会活动,学到了很多东西,也交了不少朋友<br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a> , <a href="http://www.ldsea.cn/tags/sns/" rel="tag">sns</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/137/</link>
<title><![CDATA[flex和javascript交互(转载)]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Wed, 18 Jun 2008 09:08:25 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/137/</guid> 
<description>
<![CDATA[ 
	一、在JavaScript中调用Flex方法<br/>在Flex中可以用ExternalInterface来调用Flex的方法，途径是通过在Flex应用可调用方法列表中添加指定的公用方法。在Flex应用中通过调用addCallback()可以把一个方法添加到此列表中。addCallback将一个ActionScript的方法注册为一个JavaScript和VBScript可以调用的方法。<br/>addCallback()函数的定义如下：<br/>addCallback(function_name:String, closure:Function):void<br/>function_name参数就是在Html页面中脚本调用的方法名。closure参数是要调用的本地方法，这个参数可以是一个方法也可以是对象实例。<br/><br/>举个例子：<br/><br/><div class="code">&lt;mx:Script&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;import flash.external.*;<br/>&nbsp;&nbsp;&nbsp;&nbsp;public function myFunc():Number &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 42;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;public function initApp():void &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ExternalInterface.addCallback(&quot;myFlexFunction&quot;,myFunc);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&lt;/mx:Script&gt;</div><br/>那么在Html页面中，先获得SWF对象的引用，也就是用<br/><br/>............<br/><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/131/</link>
<title><![CDATA[好消息-Adobe AIR 1.1 发布 包含中文版]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Tue, 17 Jun 2008 09:19:47 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/131/</guid> 
<description>
<![CDATA[ 
	<a href="http://www.cnbeta.com/topic.php?topicid=13"><img id="sign" src="http://www.cnbeta.com/images/topics/adobe.png" border="0" alt="Adobe" width="64" height="84" align="right" /></a> <p><span style="font-weight: bold">Adobe Integrated Runtime (AIR) 是一个跨操作系统的运行时,利用现有的Web开发技术(Flash,Flex,HTML,JavaScript,Ajax)来构建富Internet应用程序并部署为桌面应用程序.</span><br />Adobe提供AIR1.1的新版本下载,新版本包含多语言版本UI界面支持,包括简体中文,繁体中文,韩文,俄文,日文,法文,德文,意大利语,西班牙语和葡萄牙语支持 AIR 支持现有的Web技术如Flash,Flex,HTML,JavaScript和AJAX,可以用你最熟练的技术来开发您所见过的最具用户体验的RIA程序<br /><br /></p><p><span style="font-weight: bold">AIR 应用程序可以是:</span><br /><br />&nbsp;&nbsp;&nbsp; * 基于Flash 或 Flex:应用程序根内容(理解为容器)为Flash/Flex (SWF) <br />&nbsp;&nbsp;&nbsp; * 基于Flash 或 Flex 的HTML 或 PDF.应用程序的根内容为基于Flash/Flex (SWF) 的HTML<br />&nbsp;&nbsp;&nbsp; * 基于HTML,应用程序根内容为HTML, JS, CSS <br />&nbsp;&nbsp;&nbsp; * 基于HTML的Flash/Flex或PDF,应用程序根内容为基于HTML 的Flash/Flex (SWF) 或 PDF<br /><br /><span style="font-weight: bold">其它更新:</span><br />提升了对于企业部署的强壮性和统一性<br />支持应用认证的整合方法<br />内存和性能提升等<br /><br /><img src="http://www.cnbeta.com/articles/pic/down.gif" border="0" width="20" height="20" /><strong>下载:</strong><a href="http://get.adobe.com/air/?loc=cn" target="_blank">Adobe AIR 1.1</a><br /><br /></p><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a> , <a href="http://www.ldsea.cn/tags/air/" rel="tag">air</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/120/</link>
<title><![CDATA[AIR:如何保存图片到本地]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Sat, 14 Jun 2008 06:24:58 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/120/</guid> 
<description>
<![CDATA[ 
	核心提示:如果你想保存从视频，图表或表格中获取的图片数据到本地，可以使用BitmapData类。 <br/> <br/>原文地址：<br/><br/>http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=8406<br/><br/>如果你想保存从视频，图表或表格中获取的图片数据到本地，可以使用BitmapData类。<br/><br/>摘要：<br/><br/>使用BitmapData类来创建一个包含了从组件中获取的图片数据的对象，使用mx.graphics.codec包提供的方法编码为JPEG或PNG格式，然后使用AIR API提供的File和FileStream类保存到本地。<br/><br/>具体方法：<br/><br/>首先我们我们需要得到屏幕的截图，要做到这一点，我们要使用BitmapData类。比如我们想从一个命名为myChart的线状图表上获取截图：<br/><br/><br/><div class="code">import flash.display.BitmapData;<br/>var bmpd:BitmapData = new BitmapData(myChart.width,myChart.height);<br/>bmpd.draw(myChart);</div><br/><br/>然后我们需要把bitmapdata对象编译为ByteArray对象，这样我们就可以保存为文件了。这个ByteArray对象需要被格式化，我们可以使用mx.graphics.codec包中的JPEGEncoder和PNGEncoder类来实现它。<br/><br/>编码为JPEG格式：<br/><br/><br/><div class="code">import mx.graphics.codec.JPEGEncoder;<br/>//create a new instance of the encoder, and set the jpeg compression level from 0 to 100<br/>var jpgenc:JPEGEncoder = new JPEGEncoder(80);<br/>//encode the bitmapdata object and keep the encoded ByteArray<br/>var imgByteArray:ByteArray = jpgenc.encode(bmpd);</div><br/><br/>编码为PNG格式：<br/><br/><br/><div class="code">import mx.graphics.codec.JPEGEncoder;<br/>//create a new instance of the encoder<br/>var pngenc:PNGEncoder = new PNGEncoder();<br/>//encode the bitmapdata object and keep the encoded ByteArray<br/>var imgByteArray:ByteArray = pngenc.encode(bmpd);</div><br/><br/>现在我们已经准备好了ByteArray数据，我们只需要把它保存到本地就可以了。我们可以用File和File Stream类来实现。<br/><br/>建立一个JPEG文件参照:<br/><br/><br/><div class="code">//gets a reference to a new empty jpg image file in user desktop<br/>var fl:File = File.desktopDirectory.resolvePath(”snapshot.jpg”);</div><br/><br/>建立一个PNG文件参照：<br/><br/><br/><div class="code">//gets a reference to a new empty jpg image file in user desktop<br/>var fl:File = File.desktopDirectory.resolvePath(”snapshot.png”);</div><br/><br/>现在我们可以把ByteArray用File Stream保存到文件中。<br/><br/><br/><div class="code">//Use a FileStream to save the bytearray as bytes to the new file<br/>var fs:FileStream = new FileStream();<br/>try&#123;<br/>//open file in write mode<br/>fs.open(fl,FileMode.WRITE);<br/>//write bytes from the byte array<br/>fs.writeBytes(imgByteArray);<br/>//close the file<br/>fs.close();<br/>&#125;catch(e:Error)&#123;<br/>trace(e.message);<br/>&#125;</div><br/> <br/><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a> , <a href="http://www.ldsea.cn/tags/air/" rel="tag">air</a> , <a href="http://www.ldsea.cn/tags/%25E4%25B8%258B%25E8%25BD%25BD/" rel="tag">下载</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/118/</link>
<title><![CDATA[组件使用例子:用Flex AIR显示文件目录结构 [转载]]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Sat, 14 Jun 2008 05:32:02 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/118/</guid> 
<description>
<![CDATA[ 
	下面的例子使用了WindowedApplication容器和FileSystemTree 、FileSystemDataGrid 控件。在这个例子中，当点击FileSystemTree控件中的目录名时，触发一个事件，让FileSystemDataGrid控件去显示选中的目录里的文件:<br/><br/><div class="code"><br/>&lt;?xml version=”1.0″ encoding=”utf-8″?&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:WindowedApplication xmlns:mx=”http://www.adobe.com/2006/mxml”&gt;//定义了WindowedApplication容器<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:HDividedBox&gt;//水平分隔控件<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:FileSystemTree id=”tree” //注意id后面的事件处理中要引用<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width=”200″ height=”100%”<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directory=”&#123;new File(’C:&#92;&#92;’)&#125;” //设置默认的目录<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enumerationMode=”directoriesOnly” //例举模式设为只显示目录<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;change=”dataGrid.directory = File(tree.selectedItem);”/&gt; //当选择的目录发生变化时，设置dataGrid的当前目录，为tree的当前选择的目录<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:FileSystemDataGrid id=”dataGrid” //注意id前面的事件处理中引用<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width=”100%” height=”100%”<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directory=”&#123;new File(’C:&#92;&#92;’)&#125;”/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:HDividedBox&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:WindowedApplication&gt;</div>注意：每个组件要定义一个唯一的ID，作为程序引用处理标识<br/><br/><br/><br/>此文 组件使用例子:用Flex AIR显示文件目录结构 首发在:魔力谷-flash风 作者：电介质<br/><br/>版权所有，欢迎转摘，转摘请注明作者和出处！<br/><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/115/</link>
<title><![CDATA[[Flex]Flex的component和container的children的life cycle ]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Mon, 09 Jun 2008 12:10:57 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/115/</guid> 
<description>
<![CDATA[ 
	详细大家在用Flex的时候都遇到这么一个问题，new出来的component不能直接对其内部的组件进行操作，经常会提示null的错误。当然我们自己在写Script组件的时候，可以把children的创建自己放在constructor里面。这样就不会出现这种问题。但当我们在做mxml组件的时候，这个问题就非常明显了。我们必须遵循Flex的component life cycle。通常的做法是放在property里面,例如 <br/><br/><div class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/><br/>&lt;mx:Canvas xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;400&quot; height=&quot;300&quot;&gt;<br/><br/>&lt;mx:Script&gt;<br/><br/>&lt;!&#91;CDATA&#91;<br/><br/>private var title:String;<br/><br/>private var bNameChanged:Boolean;<br/><br/> <br/><br/>public function set Title(value):void<br/><br/>&#123;<br/><br/>if(title != value)<br/><br/>&#123;<br/><br/>title = value;<br/><br/>bNameChanged = true;<br/><br/>this.invalidateProperties();<br/><br/>&#125;<br/><br/>&#125;<br/><br/>override protected function commitProperties():void<br/><br/>&#123;<br/><br/>super.commitProperties();<br/><br/>if(bNameChanged)<br/><br/>&#123;<br/><br/>bNameChanged = false;<br/><br/>lblName.text = title;<br/><br/>&#125;<br/><br/>&#125;<br/><br/>&#93;&#93;&gt;<br/><br/>&lt;/mx:Script&gt;<br/><br/>&lt;mx:Label id=&quot;lblName&quot; /&gt;<br/><br/>&lt;/mx:Canvas&gt;</div><br/> <br/><br/>然而，你在用一些Container的时候，还是会遇到null的问题，这又是怎么回事呢？例如，你放两个上面的组件在一个TabNavigate里面。<br/><br/> <br/><br/><br/><div class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/><br/>&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; xmlns:local=&quot;*&quot; &gt;<br/><br/>&lt;mx:TabNavigator&gt;<br/><br/>&lt;local:TestComponent id=&quot;test1&quot; Title=&quot;test 1&quot; /&gt;<br/><br/>&lt;local:TestComponent id=&quot;test2&quot; Title=&quot;test 2&quot; /&gt;<br/><br/>&lt;/mx:TabNavigator&gt;<br/><br/>&lt;/mx:Application&gt;</div><br/>试试，保证 <br/><br/> Error #1009: 无法访问空对象引用的属性或方法。<br/><br/>这个时候，我开始抱怨了，为什么Flex为什么自己不遵守自己的游戏规则,这里TabNavigator的children还没有创建就会调用，commiteProperties 或者 updateDisplayList方法。这应该是Flex的一个Bug.<br/><br/>现在要解决这个问题就只有让TabNavigator在创建children的时候就要把所有的children都创建。这个时候我们就要关注Container.createPolicy属性了。Container内部的children不是在createChild里面创建的，至于其children的创建时机，就好好看看<br/><br/>ContainerCreationPolicy,而且Container内部的children(即通过mxml加的children)和createChildren里创建的chidren可以理解为不同的类型。<br/><br/>在上面的例子里面的TabNavigator加上 createPolicy = "ALL"所有的文件就解决了。<br/><br/> <br/><br/>如果有什么问题，请大家指正.<br/><br/><br/>转自：http://www.cnblogs.com/tionase/archive/2007/04/02/696852.aspx<br/><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/114/</link>
<title><![CDATA[对 Adobe Flex的 十大误解 ]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Fri, 06 Jun 2008 13:13:18 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/114/</guid> 
<description>
<![CDATA[ 
	转自：http://www.niuc.net/post/141/<br/><br/>首先说明的是，这篇文章不是我原创,而是来自infoq.com上的Jon Rose写的一篇文章,原贴:这里,不过我说的内容根据我的经验有很大部分是与原来不同的.<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对 ADOBE FLEX 的十大误解,在silverlight,ajax的竞争下，很多人都会怀疑,甚至疑问用FLEX吗?FLEX不好，为什么?因为:<br/><br/>1,用户需要重新或者新增安装插件来运行FLEX<br/>&nbsp;&nbsp;&nbsp;&nbsp; 其实,目前在电脑平台上,用的最多的插件应该是Flash Player吧,虽然运行FLEX 需要 9 以上版本,不过按照ADOBE官方的调查,目前电脑平台上，已经有94%的用户安装了Flash Player,而且基本都是 9 或者9以上的版本,所以你基本不用担心用户没办法运行你开发的FLEX程序.<br/>&nbsp;&nbsp;&nbsp;&nbsp; 但是AIR程序呢?OK,这需要等到明年也就是2008,才会正式推出1.0版本的RUNTIME.容量大约为9兆左右,看起来很大，不过值得幸运的是，在用户安装AIR程序时,程序会自动检测下载AIR RUNTIME程序,只要安装一次,以后再运行AIR程序就无需再次安装.<br/><br/>&nbsp;&nbsp;2,Flash Player 过于封闭<br/>&nbsp;&nbsp;&nbsp;&nbsp;Flash Player的核心Tamarin Virtual Machine(猴子虚拟机?),目前已经在Mozilla下成为了开源项目,当然作为商业产品，ADOBE还没大方到全部开源这个地步,不过毕竟也算开了点，具体的开源信息可以到osflash.org上查询.根据我的调查，目前已经有几个项目是针对开源了的核心而开发的,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;无论是FLEX还是AIR目前基本是同一步骤向开源方向前进.<br/><br/>&nbsp;&nbsp;3,Flash 只是在设计动画，视频播放等乱七八糟的方向有长处<br/>&nbsp;&nbsp;&nbsp;&nbsp;去每个网站，我们都避免不了该死的FLASH广告,有的更加可恶的是还是视频播放，还关不掉。久而久之,Flash就在大众落下了个花蝴蝶的形象.<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FLASH:这不是我的错啊<br/>&nbsp;&nbsp;&nbsp;&nbsp;我:别急别急,听我细细道来.<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有短必有长,比如动画播放，不就是为增加Flash player的占有率立下了汗马功劳?而且严格上来说,Flash CS3的确是为设计师所准备的，而FLEX却是为程序员所准备的，而两者如此的靠近，就是为了设计师与程序员能够更加完美的合作.而且目前国内开发FLEX的，还有很多是有FLASH基础的.毕竟优秀的设计是会给你的程序加很大分的.更何况FLEX涉及的范围实在太广.<br/><br/>4,FLEX不是开发商业程序的好选择,那只是业余产品<br/>&nbsp;&nbsp;&nbsp;&nbsp;在几年前，FLASH的代码写法在正统的程序员眼里，那是可笑的。不过随着AS3.0的发布,FLASH,FLEX开发越来越向正统开发方式靠近.那到底是不是开发商业程序的好选择呢?那就看些例子吧.我想这方面，ADOBE应该会有很多程序推荐的.比如这个消息:Oracle Chooses Flex <br/><br/>5,FLEX太贵了.<br/>&nbsp;&nbsp;&nbsp;&nbsp; 这个,这个,在盗版横行的我们这个地方,好象不是个问题.我还听说过这么一个故事:某家外企,来了个德国FLEX开发工程师,牛啊,人家说了用的是正版的.结果要求他把序列号拿出来共享下，结果是满大街都一样的破解注册码.<br/><br/>6,FLEX需要单独的专用服务器<br/>&nbsp;&nbsp; FLEX可以运行在任何的:web server, application server, and database server.FLEX更应该说是前台程序,我说FLEX涉及的范围太广就是这个问题,你一不小心，很容易迷失在开发服务器端上，因为都能用.比如我喜欢PHP,大部分会用到AMF.<br/><br/>7,FLEX太难学了<br/>&nbsp;&nbsp; 其实FLEX很简单,我想应该是最简单的程序语言了吧.唯一难点是在于他的丰富性.要把持住自己专注一点是比较难的.如果你学过C,C&nbsp;&nbsp;,甚至是大学里的编程课程,那学FLEX就太简单了。<br/><br/>8,用FLEX,我的整个大程序需要重新构建<br/>&nbsp;&nbsp; 再次说明FLEX是前台程序,他的后台基本不需要改变,如果你用JAVA或者其他再加EJBs, Spring, POJOs等后台程序开发了一个程序，你无须修后台程序,直接用FLEX就可以调用以上的后台程序.<br/><br/>9 ,FLEX缺少后退键这个功能<br/>&nbsp;&nbsp; 在开发FLASH 网站最需要解答的这个问题,谁也不希望回不到上一页看过的内容,而是重新加载了网站，不过FLEX3目前已经有后退键这个功能.<br/><br/>10 , 我可以用AJAX,SILVERLIGHT做出FLEX可以做出的任何东西.<br/>&nbsp;&nbsp;&nbsp;&nbsp;理论上来讲,任何技术都是相通的，没有说你做的了，我却做不了。不同的只是花的时间,成本不同而已.你选择AJAX也好,SILVERLIGHT也好,只不过路不同。别忘了，用FLEX也可以做出AJAX,SILVERLIGHT能做出的任何东西.不过FLEX还能用java开发.从FLEX 2以来，多少AJAX开发者投入到FLEX的怀抱啊.SilverLight?哦，这个雷声大雨点小，给我看个耳目一新的DEMO吧.<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;磕磕绊绊的翻译总算写完了,下面是个人观点:我们国内的FLEX开发离世界级开发落后了很多,我想很大部分在于ADOBE根本不重视中国市场,当然这也是有客观原因的,毕竟盗版过多,满大街的FLASH产品,基本都是破解,甚至盗窃他人的成果.急功进利是最大的问题，试问国内从2000年到现在出现了多少优秀的FLASH开发工程师呢?最多的应该是动画设计师吧.<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;那为什么很多大网站支持silverlight呢?因为:在这里MS很大方,ADOBE不鸟你,我想换谁,都会愿意支持MS,也就是silverlight的.<br/><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/113/</link>
<title><![CDATA[Flex HTTPService如何给后台传递参数【转载】]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Fri, 06 Jun 2008 09:04:37 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/113/</guid> 
<description>
<![CDATA[ 
	<br/>最近看一些文档,总结了一些<mx:HTTPService>给后台传递参数的方法,列举如下:<br/><br/>方法1:采用URLVariables对象<br/><br/><div class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/>&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;<br/>&nbsp;&nbsp;&nbsp;&nbsp; layout=&quot;absolute&quot; fontSize=&quot;12&quot;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Script&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!&#91;CDATA&#91;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;import mx.controls.Alert;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;import mx.rpc.events.ResultEvent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//对提交给后台的参数进行UTF-8的编码处理<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private function httpEncoding(param:String):String&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return encodeURIComponent(param);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private function httpEncoding0(param:String):String&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return param;//encodeURI(param);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private function doRequest():void&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btn_do.enabled=false;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var url:String = &quot;http://localhost:8600/grid.jsp&quot;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//以下那样写后台会乱码,不管是否做URI编码转换<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//url += &quot;?user=&quot;+httpEncoding0(&quot;用户名&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//url += &quot;&amp;psw=&quot;+httpEncoding0(&quot;密码&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//trace(url);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srv.url = url;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//srv.send();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//以下这样写正常<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var params:URLVariables = new URLVariables();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//这个user,psw就是传入后台的参数user,jsp就用 request.getParameter(&quot;user&quot;)来取<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params.user = httpEncoding(&quot;用户名&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params.psw = httpEncoding(&quot;密码&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srv.send(params);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private function resultHandler(event:ResultEvent):void&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Alert.show(&quot;与后台交互结束,前台开始取得的数据...&quot;,&quot;提示信息&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btn_do.enabled=true;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#93;&#93;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:Script&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:HTTPService id=&quot;srv&quot; result=&quot;resultHandler(event);&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Panel title=&quot;测试与jsp后台交互&quot; layout=&quot;absolute&quot; width=&quot;100%&quot; height=&quot;90%&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Button id=&quot;btn_do&quot; label=&quot;取得数据&quot; click=&quot;doRequest();&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Spacer height=&quot;1&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:DataGrid dataProvider=&quot;&#123;srv.lastResult.catalog.product&#125;&quot; width=&quot;100%&quot; height=&quot;100%&quot; y=&quot;28&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:Panel&gt;<br/>&lt;/mx:Application&gt;</div><br/><br/>方法2:采用<mx:request/>,同时也演示了mx:State的用法,[来自网上]<br/><br/><div class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br/>&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:states&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:State name=&quot;Logged In&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:SetProperty target=&quot;&#123;panel1&#125;&quot; name=&quot;width&quot; value=&quot;95%&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:SetProperty target=&quot;&#123;panel1&#125;&quot; name=&quot;height&quot; value=&quot;95%&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:RemoveChild target=&quot;&#123;password&#125;&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:RemoveChild target=&quot;&#123;username&#125;&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:RemoveChild target=&quot;&#123;label1&#125;&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:RemoveChild target=&quot;&#123;Submit&#125;&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:RemoveChild target=&quot;&#123;label2&#125;&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:SetProperty target=&quot;&#123;panel1&#125;&quot; name=&quot;title&quot; value=&quot;Members Section&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:AddChild relativeTo=&quot;&#123;panel1&#125;&quot; position=&quot;lastChild&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Label x=&quot;10&quot; y=&quot;10&quot; text=&quot;Welcome to the Members Section!&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:AddChild&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:AddChild relativeTo=&quot;&#123;panel1&#125;&quot; position=&quot;lastChild&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Label x=&quot;10&quot; y=&quot;36&quot; text=&quot;Here you can do great things, like join the forums @ Viper Creations!&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:AddChild&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:AddChild relativeTo=&quot;&#123;panel1&#125;&quot; position=&quot;lastChild&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Label x=&quot;10&quot; y=&quot;62&quot; text=&quot;Label&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:AddChild&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:State&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:states&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Script&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!&#91;CDATA&#91;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;import mx.rpc.events.ResultEvent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#93;&#93;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:Script&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Script&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<br/><br/>&lt;!&#91;CDATA&#91;<br/><br/>private function checkLogin(evt:ResultEvent):void<br/>&#123;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;if(evt.result.loginsuccess == &quot;yes&quot;)<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;currentState = &quot;Logged In&quot;;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;if(evt.result.loginsuccess == &quot;no&quot;)<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mx.controls.Alert.show(&#039;Invalid username/password&#039;);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&#125;<br/><br/>&#93;&#93;&gt;<br/><br/>&lt;/mx:Script&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:HTTPService id=&quot;login_user&quot; result=&quot;checkLogin(event)&quot; showBusyCursor=&quot;true&quot; method=&quot;POST&quot; url=&quot;http://www.vipercreations.com/site_admin/login.php&quot; useProxy=&quot;false&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:request xmlns=&quot;&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;username&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;username.text&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/username&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;password&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;password.text&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/password&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:request&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:HTTPService&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Panel resizeEffect=&quot;Resize&quot; width=&quot;250&quot; height=&quot;200&quot; layout=&quot;absolute&quot; title=&quot;Login System&quot; horizontalCenter=&quot;0&quot; verticalCenter=&quot;-2&quot; id=&quot;panel1&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Label x=&quot;10&quot; y=&quot;10&quot; text=&quot;Username:&quot; id=&quot;label1&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:TextInput x=&quot;10&quot; y=&quot;36&quot; id=&quot;username&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Label x=&quot;10&quot; y=&quot;66&quot; text=&quot;Password:&quot; id=&quot;label2&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:TextInput x=&quot;10&quot; y=&quot;92&quot; id=&quot;password&quot; displayAsPassword=&quot;true&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mx:Button x=&quot;10&quot; y=&quot;122&quot; label=&quot;Submit&quot; id=&quot;Submit&quot; click=&quot;login_user.send();&quot;/&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/mx:Panel&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&lt;/mx:Application&gt;</div><br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item><item>
<link>http://www.ldsea.cn/post/112/</link>
<title><![CDATA[Flex 3 正式版注册码]]></title> 
<author>海蓝 &lt;loveldsea@gmail.com&gt;</author>
<category><![CDATA[Program Life - Other]]></category>
<pubDate>Fri, 06 Jun 2008 08:31:48 +0000</pubDate> 
<guid>http://www.ldsea.cn/post/112/</guid> 
<description>
<![CDATA[ 
	注册码:1377-4167-5844-4698-0048-5821<br/>Tags - <a href="http://www.ldsea.cn/tags/flex/" rel="tag">flex</a>
]]>
</description>
</item>
</channel>
</rss>