<?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>IT妖怪 &#187; Adobe AIR</title>
	<atom:link href="http://blog.ityao.com/archives/category/adobe-ria/adobeair/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.ityao.com</link>
	<description>热爱生活，热爱程序</description>
	<lastBuildDate>Wed, 03 Aug 2011 02:56:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>AIR 2.5 国庆假期回来之后发布</title>
		<link>http://blog.ityao.com/archives/782</link>
		<comments>http://blog.ityao.com/archives/782#comments</comments>
		<pubDate>Tue, 21 Sep 2010 02:35:39 +0000</pubDate>
		<dc:creator>Silver</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=782</guid>
		<description><![CDATA[下面是从开发者社区得到的信息！ Michael Chou wrote: Hello Everybody, We are pleased to announce that the AIR 2.5 runtime for Android will be available on the Android Market starting 10/8. On this date we will make an announcement to this prerelease when the AIR runtime is live on the Android Market, after which you can upload your AIR [...]]]></description>
			<content:encoded><![CDATA[<p>下面是从开发者社区得到的信息！</p>
<p>Michael Chou wrote:</p>
<p>Hello Everybody,</p>
<p>We are pleased to announce that the AIR 2.5 runtime for Android will be available on the Android Market starting 10/8.  On this date we will make an announcement to this prerelease when the AIR runtime is live on the Android Market, after which you can upload your AIR applications for end user download. </p>
<p>Because 10/8 is rapidly approaching, we encourage all of you to test your applications against the latest AIR for Android SDK/runtime on this prerelease site.  The 09/16/10 build will be one of our final builds, therefore it’s critical that we identify any issues as soon as possible.  If you discover any new problems with the AIR SDK or runtime, please file a bug immediately.</p>
<p>The AIR 2.5 SDK will be released on  http://www.adobe.com/products/air/ at a later date, but we will drop the final AIR 2.5 SDK/runtime to this prerelease site for you to repackage and test your application before uploading it to the Android Market.  As a reminder, all of you are under an NDA that prevents you from disclosing any of this information publicly. </p>
<p>Please accept our heartfelt thanks in making this prerelease program a successful one (and the largest Adobe prerelease program ever).  The excellent feedback you have given us have been tremendously valuable in enabling us to launch the highest quality product possible.</p>
<p>Sincerely,<br />
The AIR Team </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/782/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[转]FlashBuilder中使用fl组件</title>
		<link>http://blog.ityao.com/archives/765</link>
		<comments>http://blog.ityao.com/archives/765#comments</comments>
		<pubDate>Wed, 04 Aug 2010 04:04:18 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[ADOBE RIA]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=765</guid>
		<description><![CDATA[意思就是：用Flash CS创建一个flash，将需要的fl组件拖进舞台，然后导出swc文件 在FlashBuilder中引入该swc，这时就能在代码中直接new这个fl组件了 How to Use Flash CS&#8217;s Components in Flex Builder To generate the .swc file in Flash CS3, we follow these steps: 1) Make a new Flash CS3 ActionScript 3.0 .fla file. 2) Drag the desired component(s) to the Library. In this example, we&#8217;ll drag the TextArea component to the Library. 3) Choose [...]]]></description>
			<content:encoded><![CDATA[<p>意思就是：用Flash CS创建一个flash，将需要的fl组件拖进舞台，然后导出swc文件</p>
<p>在FlashBuilder中引入该swc，这时就能在代码中直接new这个fl组件了</p>
<p>How to Use Flash CS&#8217;s  Components in Flex Builder</p>
<p>To generate the .swc file in Flash CS3, we follow these steps:</p>
<p>1) Make a new Flash CS3 ActionScript 3.0 .fla file.<br />
2) Drag the desired component(s) to the Library. In this example, we&#8217;ll drag the TextArea component to the Library.<br />
3) Choose File &gt; Export &gt; Export Movie.<br />
4) For File name, enter v3components.swf. (We don&#8217;t even want the generated .swf, but there&#8217;s no other way to get the .swc to compile.)<br />
5) Select a folder in which to save the .swf file.<br />
6) Click Save.<br />
7) In the Export Flash Player dialog, check Export SWC.<br />
 <img src='http://blog.ityao.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Click OK.</p>
<p>The preceding steps generate two files, cs3 components.swf and v3components.swc, both of which are placed in the folder selected in Step 5.</p>
<p>Now let&#8217;s use cs3 components.swc in a Flex Builder project. Follow these steps:</p>
<p>1) In Flex Builder, select File &gt; New &gt; ActionScript Project.<br />
2) For Project name, enter &#8220;V3Test.as&#8221;.<br />
3) Click Next.<br />
4) For Main source folder, enter &#8220;src&#8221;.<br />
5) For Main application file, enter &#8220;V3Test.as&#8221;.<br />
6) On the Library path tab, click Add SWC.<br />
7) Browse to the v3components.swc file from the preceding procedure.<br />
 <img src='http://blog.ityao.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Click Finish.<br />
9) Update the code in cs Test.as so it looks like this:</p>
<pre class="brush: plain; title: ; notranslate">
package {
  import flash.display.Sprite;
  import fl.controls.TextArea;
  public class V3Test extends Sprite {
    public function V3Test() {
      var t:TextArea = new TextArea();
      t.text = &quot;You're not cookin'&quot;;
      addChild(t);
    }
  }
</pre>
<p>}<br />
10) Run the project.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/765/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 4.1以及Flash Builder 4.0.1更新</title>
		<link>http://blog.ityao.com/archives/749</link>
		<comments>http://blog.ityao.com/archives/749#comments</comments>
		<pubDate>Fri, 02 Jul 2010 01:37:52 +0000</pubDate>
		<dc:creator>Silver</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[ADOBE RIA]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=749</guid>
		<description><![CDATA[针对Flash Player 10.1的开发工具更新，快更新吧！ Adobe has publicly pushed the Flex 4.1/Flash Builder 4.0.1 update, which includes: The new Layout Mirroring feature for repurposing Flex UIs for deployment in right-to-left locales Native support for Flash Player 10.1 and AIR 2 in the Flex SDK Native support in Flash Builder 4.0.1 for building apps targeting SDK 4.1, AIR [...]]]></description>
			<content:encoded><![CDATA[<p>针对Flash Player 10.1的开发工具更新，快更新吧！</p>
<p>Adobe has publicly pushed the Flex 4.1/Flash Builder 4.0.1 update, which includes:</p>
<p>The new Layout Mirroring feature for repurposing Flex UIs for deployment in right-to-left locales<br />
Native support for Flash Player 10.1 and AIR 2 in the Flex SDK<br />
Native support in Flash Builder 4.0.1 for building apps targeting SDK 4.1, AIR 2 or FP 10.1<br />
Many critical bugfixes and enhancement requests for both Flex SDK and Flash Builder </p>
<p>Adobe has also officially debuted the next release of the Flex SDK, code-named Hero. We share with the world our amazing story of a single unified Flex framework that can be used to build applications for the web, desktop and mobile devices. With today’s debut, we released many new documents and feature specifications, including:</p>
<p>Inaugural launch of the new Hero opensource Flex page<br />
Posting of several new Hero desktop and Hero mobile feature specifications<br />
Updated the labs.adobe.com Flex Mobile content to announce our intent to add mobile development capabilities directly into the core Flex framework, including<br />
o Updating the Flex and Mobile Whitepaper<br />
o Updating the Flex and Mobile FAQ</p>
<p>Please help us spread the word regarding these announcements. You can find more details in the following two blog postings:<br />
Flex SDK 4 and Flash Builder 4 Updates Now Available http://blogs.adobe.com/flex/archives/2010/06/flex_sdk_4_and_flash_builder_4.html<br />
Introducing….Hero! </p>
<p>http://blogs.adobe.com/flex/archives/2010/06/introducinghero.html</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/749/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Flash Player 10.1 and Adobe AIR 2 正式发布</title>
		<link>http://blog.ityao.com/archives/737</link>
		<comments>http://blog.ityao.com/archives/737#comments</comments>
		<pubDate>Fri, 11 Jun 2010 01:55:41 +0000</pubDate>
		<dc:creator>Silver</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[ADOBE RIA]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=737</guid>
		<description><![CDATA[Rachel Luxemburg wrote: Hi All! Adobe Flash Player 10.1 and Adobe AIR 2 are now available for Windows, Mac and Linux operating systems. To download the runtimes, go to http://get.adobe.com/flashplayer/ for Flash Player and http://get.adobe.com/air/ for AIR 2. More info is posted on the AIR team blog, http://blogs.adobe.com/air/ and the Flash Player Team blog http://blogs.adobe.com/flashplayer/. [...]]]></description>
			<content:encoded><![CDATA[<p>Rachel Luxemburg wrote:</p>
<p>Hi All!</p>
<p>Adobe Flash Player 10.1 and Adobe AIR 2 are now available for Windows, Mac and Linux operating systems. To download the runtimes, go to http://get.adobe.com/flashplayer/ for Flash Player and<br />
http://get.adobe.com/air/ for AIR 2.</p>
<p>More info is posted on the AIR team blog, http://blogs.adobe.com/air/ and the Flash Player Team blog http://blogs.adobe.com/flashplayer/.</p>
<p>We’re really excited that we’re finally &#8220;over the finish line&#8221; with these releases, there’s a lot of new features &#038; some real performance improvements. </p>
<p>Please help spread the word, and enjoy!</p>
<p>Rachel </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/737/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsley AIR发布问题解决方法</title>
		<link>http://blog.ityao.com/archives/731</link>
		<comments>http://blog.ityao.com/archives/731#comments</comments>
		<pubDate>Sat, 05 Jun 2010 03:51:30 +0000</pubDate>
		<dc:creator>Silver</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[ADOBE RIA]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[parsley]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=731</guid>
		<description><![CDATA[之前在项目中使用Parsley做为框架，在把依赖的swc用RSL进行发布AIR的情况下，会Inject不了， 后来发现是AIR在IDE里面进行release发布的时候应该是没有把相关的metadata实现编译进去，于是就查了一下，发现不使用IDE的重新编译，使用命令行手工打包可以解决这个问题， 命令行如下：]]></description>
			<content:encoded><![CDATA[<p>之前在项目中使用Parsley做为框架，在把依赖的swc用RSL进行发布AIR的情况下，会Inject不了，<br />
后来发现是AIR在IDE里面进行release发布的时候应该是没有把相关的metadata实现编译进去，于是就查了一下，发现不使用IDE的重新编译，使用命令行手工打包可以解决这个问题，<br />
命令行如下：</p>
<pre class="brush: plain; title: ; notranslate">
adt -package -storetype pkcs12 -keystore certificat e.p12 -storepass 123456 TestAirMetadata.air bin-debug/TestAirMetadata-app.xml -C bin-debug .
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/731/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex User Group文档&#8211;AIR介绍</title>
		<link>http://blog.ityao.com/archives/706</link>
		<comments>http://blog.ityao.com/archives/706#comments</comments>
		<pubDate>Thu, 27 May 2010 02:18:44 +0000</pubDate>
		<dc:creator>Silver</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[ADOBE RIA]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[doc]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=706</guid>
		<description><![CDATA[一个很有用的PPT,用于向不了解这技术的人介绍 点击下载]]></description>
			<content:encoded><![CDATA[<p>一个很有用的PPT,用于向不了解这技术的人介绍<br />
<a href="http://www.ityao.com/tool/ityao.com_introToAIR_community.rar">点击下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/706/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex4动态加载和切换CSS</title>
		<link>http://blog.ityao.com/archives/699</link>
		<comments>http://blog.ityao.com/archives/699#comments</comments>
		<pubDate>Wed, 26 May 2010 02:43:54 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[ADOBE RIA]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=699</guid>
		<description><![CDATA[Flex4中动态加载CSS文件的方式已经和Flex3有了一定的区别 主要步骤如下： 1.编写不同的CSS文件 见后文 2.将CSS文件编译成SWF文件 在FlashBuilder中右键CSS文件，选择Compile CSS to SWF， 这时bin-debug目录下的对应位置就会生成一个与CSS同名的SWF文件。 选中后该选项前会有勾，之后只要修改了CSS文件，就会自动编译成SWF 2.用styleManager加载SWF 代码中这样写： this.styleManager.loadStyleDeclarations2(&#8220;MyCss1.swf&#8221;);   //代码中填写上一步由CSS生成的SWF文件路径 CSS写法： MyCss1.css /* CSS file */ /*命名空间*/ @namespace s &#8220;library://ns.adobe.com/flex/spark&#8221;; @namespace mx &#8220;library://ns.adobe.com/flex/mx&#8221;; /*使用skin类来定义皮肤，所以要用ClassReference函数*/ s&#124;List{ skin-class:ClassReference(&#8220;skins.ListSkin1&#8243;); } /*符号#代表指定的ID*/ s&#124;Label#labelExamples{ font-size:14; color:#990099; } s&#124;CheckBox{ font-size:9; color:#FF3300; } s&#124;RadioButton{ font-size:92; color:#990099; } s&#124;Button{ font-size:32; color:#FF3300; } 注：CSS中无法设置ItemRenderer，所以如果要实现不同CSS用不同的ItemRenderer，为各个CSS指定不同的skin类，并且在skin类中分别设置的ItemRenderer 例如，我的例子中要为List设置不同的ItemRenderer，就不要写成&#60;s:List itemRenderer=&#8221;itemRenderers.ListItemRenderer1&#8243;&#8230;/&#62; 而要在CSS中为List指定skinClass为skins.ListSkin1，代码：skin-class:ClassReference(&#8220;skins.ListSkin1&#8243;); 然后，在skin.ListSkin1中设置ItemRenderer，代码： [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Flex4中动态加载CSS文件的方式已经和Flex3有了一定的区别</p>
<p>主要步骤如下：</p>
<h5>1.编写不同的CSS文件</h5>
<p>见后文</p>
<h5>2.将CSS文件编译成SWF文件</h5>
<p>在FlashBuilder中右键CSS文件，选择Compile CSS to SWF，<br />
<span id="more-699"></span><br />
这时bin-debug目录下的对应位置就会生成一个与CSS同名的SWF文件。</p>
<p>选中后该选项前会有勾，之后只要修改了CSS文件，就会自动编译成SWF</p>
<h5>2.用styleManager加载SWF</h5>
<p>代码中这样写：</p>
<p>this.styleManager.loadStyleDeclarations2(&#8220;MyCss1.swf&#8221;);   //代码中填写上一步由CSS生成的SWF文件路径</p>
<hr />
<h4>CSS写法：</h4>
<h4>MyCss1.css</h4>
<p>/* CSS file */</p>
<p>/*命名空间*/</p>
<p>@namespace s &#8220;library://ns.adobe.com/flex/spark&#8221;;</p>
<p>@namespace mx &#8220;library://ns.adobe.com/flex/mx&#8221;;</p>
<p>/*使用skin类来定义皮肤，所以要用ClassReference函数*/</p>
<p>s|List{</p>
<p>skin-class:ClassReference(&#8220;skins.ListSkin1&#8243;);</p>
<p>}</p>
<p>/*符号#代表指定的ID*/</p>
<p>s|Label#labelExamples{</p>
<p>font-size:14;</p>
<p>color:#990099;</p>
<p>}</p>
<p>s|CheckBox{</p>
<p>font-size:9;</p>
<p>color:#FF3300;</p>
<p>}</p>
<p>s|RadioButton{</p>
<p>font-size:92;</p>
<p>color:#990099;</p>
<p>}</p>
<p>s|Button{</p>
<p>font-size:32;</p>
<p>color:#FF3300;</p>
<p>}</p>
<p><strong><span style="font-family: mceinline;">注：CSS中无法设置ItemRenderer，所以如果要实现不同CSS用不同的ItemRenderer，为各个CSS指定不同的skin类，并且在skin类中分别设置的ItemRenderer</span></strong></p>
<p><strong><span style="font-family: mceinline;">例如，我的例子中要为List设置不同的ItemRenderer，就不要写成&lt;s:List itemRenderer=&#8221;itemRenderers.ListItemRenderer1&#8243;&#8230;/&gt;</span></strong></p>
<p><strong><span style="font-family: mceinline;">而要在CSS中为List指定skinClass为skins.ListSkin1，代码：skin-class:ClassReference(&#8220;skins.ListSkin1&#8243;);</span></strong></p>
<p><strong><span style="font-family: mceinline;">然后，在skin.ListSkin1中设置ItemRenderer，代码： </span></strong></p>
<p><strong><span style="font-family: mceinline;">&lt;s:DataGroup id=&#8221;dataGroup&#8221; itemRenderer=&#8221;itemRenderers.ListItemRenderer1&#8243;&gt;</span></strong></p>
<p><span style="font-family: mceinline;"> &lt;s:layout&gt;&#8230;</span></p>
<p><span style="font-family: mceinline;"><br />
</span></p>
<div>
<h4>MyCss2.css——另一个CSS文件</h4>
<p>/* CSS file */</p>
<p>@namespace s &#8220;library://ns.adobe.com/flex/spark&#8221;;</p>
<p>@namespace mx &#8220;library://ns.adobe.com/flex/mx&#8221;;</p>
<p>/* 使用了另一个Skin类*/</p>
<p>s|List{</p>
<p>skin-class:ClassReference(&#8220;skins.ListSkin2&#8243;);</p>
<p>}</p>
<p>s|Label#labelExamples{</p>
<p>font-size:42;</p>
<p>color:#009966;</p>
<p>}</p>
<p>s|CheckBox{</p>
<p>font-size:22;</p>
<p>color:#009966;</p>
<p>}</p>
<p>s|RadioButton{</p>
<p>font-size:20;</p>
<p>color:#009966;</p>
<p>}</p>
<p>s|Button{</p>
<p>font-size:12;</p>
<p>color:#00FFFF;</p>
<p>}</p>
<hr />完整源代码：<a rel="attachment wp-att-700" href="http://blog.ityao.com/archives/699/switchcssinruntime">SwitchCSSInRuntime</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/699/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex中的Base64加解密</title>
		<link>http://blog.ityao.com/archives/677</link>
		<comments>http://blog.ityao.com/archives/677#comments</comments>
		<pubDate>Mon, 10 May 2010 10:40:54 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[ADOBE RIA]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=677</guid>
		<description><![CDATA[Flex sdk3就内置了Base64的加/解密工具类 分别是 mx.utils.Base64Encoder mx.utils.Base64Decoder Base64Encoder用法如下： Base64Decoder用法如下： 完成代码：]]></description>
			<content:encoded><![CDATA[<p>Flex sdk3就内置了Base64的加/解密工具类<br />
分别是<br />
mx.utils.Base64Encoder<br />
mx.utils.Base64Decoder</p>
<h5>Base64Encoder用法如下：</h5>
<pre class="brush: plain; title: ; notranslate">
var $orgin:String = this.textOrigi.text;//获取原始字符串
var $base64:Base64Encoder = new Base64Encoder();
$base64.insertNewLines = false;//该值等于true时，输出的结果会自动换行，默认为true，
$base64.encodeUTFBytes($orgin);//这里注意，如果想加密中文就不要使用$base64.encode();
var $result:String = $base64.toString();//输出结果
</pre>
<h5>Base64Decoder用法如下：</h5>
<pre class="brush: plain; title: ; notranslate">
				var $origi:String = this.textEncodeResult.text;//获取原始字符串
				var $base64:Base64Decoder = new Base64Decoder();
				$base64.decode($origi);
				var $result:String = $base64.toByteArray().toString();//输出结果，decode类只能输出ByteArray类型的数据，因此要转换成string
</pre>
<h5>完成代码：</h5>
<pre class="brush: plain; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
			   xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
			   xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot; minWidth=&quot;955&quot; minHeight=&quot;600&quot;&gt;

	&lt;fx:Script&gt;
		&lt;![CDATA[
			import mx.utils.Base64Decoder;
			import mx.utils.Base64Encoder;
			protected function btnEncode_clickHandler(event:MouseEvent):void
			{
				var $orgin:String = this.textOrigi.text;//获取原始字符串
				var $base64:Base64Encoder = new Base64Encoder();
				$base64.insertNewLines = false;//该值等于true时，输出的结果会自动换行，默认为true，
				$base64.encodeUTFBytes($orgin);//这里注意，如果想加密中文就不要使用$base64.encode();
				var $result:String = $base64.toString();//输出结果
				this.textEncodeResult.text = $result
			}

			protected function btnDecode_clickHandler(event:MouseEvent):void
			{
				var $origi:String = this.textEncodeResult.text;//获取原始字符串
				var $base64:Base64Decoder = new Base64Decoder();
				$base64.decode($origi);
				var $result:String = $base64.toByteArray().toString();//输出结果，decode类只能输出ByteArray类型的数据，因此要转换成string
				this.textDecodeResult.text = $result
			}

		]]&gt;
	&lt;/fx:Script&gt;

	&lt;mx:Form width=&quot;100%&quot;&gt;
		&lt;mx:FormItem label=&quot;原始字符串：&quot; width=&quot;100%&quot;&gt;
			&lt;s:TextArea editable=&quot;true&quot; id=&quot;textOrigi&quot; width=&quot;100%&quot; text=&quot;在这里输入原始字符串&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem&gt;
			&lt;s:Button id=&quot;btnEncode&quot; label=&quot;Encode Base64&quot; enabled=&quot;{this.textOrigi.text!=''}&quot; click=&quot;btnEncode_clickHandler(event)&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem label=&quot;Encode 结果：&quot; width=&quot;100%&quot;&gt;
			&lt;s:TextArea editable=&quot;false&quot; id=&quot;textEncodeResult&quot; width=&quot;100%&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem&gt;
			&lt;s:Button id=&quot;btnDecode&quot; enabled=&quot;{this.textEncodeResult.text!=''}&quot; label=&quot;Decode Base64&quot; click=&quot;btnDecode_clickHandler(event)&quot;/&gt;
		&lt;/mx:FormItem&gt;
		&lt;mx:FormItem label=&quot;Decode 结果：&quot; width=&quot;100%&quot;&gt;
			&lt;s:TextArea editable=&quot;false&quot; id=&quot;textDecodeResult&quot; width=&quot;100%&quot; text=&quot;点击Decode Base64按钮后，这里的结果应该和原始字符串相同&quot;/&gt;
		&lt;/mx:FormItem&gt;
	&lt;/mx:Form&gt;
&lt;/s:Application&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/677/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FlexBuilder中使用代码片断工具</title>
		<link>http://blog.ityao.com/archives/665</link>
		<comments>http://blog.ityao.com/archives/665#comments</comments>
		<pubDate>Wed, 05 May 2010 11:25:40 +0000</pubDate>
		<dc:creator>syw00syw</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[ADOBE RIA]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=665</guid>
		<description><![CDATA[1.1 工具介绍 使用代码片断工具，您可以存储内容（文档中重复出现的代码如public function …( ):void{   }等）以便快速重复使用。多种软件都含有此工具（例如Dreamweaver），flexbuilder中此工具包含在CFEclipse插件中。 1.2 安装与使用 安装步骤： a．  帮助       安装新软件； b．  使用（W）一栏中输入地址   http://www.cfeclipse.org/update c．  输入网址后按Enter，程序连接服务器，窗口显示“暂挂中”，连接完毕后窗口会显示出可供安装的程序，选择CFEclipse CFML Editor   点 下一步 d．  点 完成  开始下载   出现安全警告提示软件未签名 点击确定  之后按提示重启flex builder e．  打开工具窗口（Snip Tree View）； f．   编辑代码片断   新建片断 g．  按钮插入该片断（只适用于AS代码文件） h．  片断中适用参量：$${    }   如图中代码 在插入该片断时会出现提示框，要求输入$${}标记的参数值name  如图 确定后整段代码被插入]]></description>
			<content:encoded><![CDATA[<h2>1.1 工具介绍</h2>
<p>使用代码片断工具，您可以存储内容（文档中重复出现的代码如public function …( ):void{   }等）以便快速重复使用。多种软件都含有此工具（例如Dreamweaver），flexbuilder中此工具包含在CFEclipse插件中。</p>
<h2>1.2 安装与使用</h2>
<p>安装步骤：</p>
<p>a．  帮助       安装新软件；</p>
<p><a rel="attachment wp-att-657" href="http://blog.ityao.com/archives/665/attachment/001"><img class="alignnone size-medium wp-image-657" src="http://blog.ityao.com/wp-content/uploads/2010/05/001-259x300.jpg" alt="" width="259" height="300" /></a></p>
<p>b．  使用（W）一栏中输入地址   <a href="http://www.cfeclipse.org/update">http://www.cfeclipse.org/update</a></p>
<p><a rel="attachment wp-att-658" href="http://blog.ityao.com/archives/665/attachment/002"><img class="alignnone size-medium wp-image-658" src="http://blog.ityao.com/wp-content/uploads/2010/05/002-282x300.jpg" alt="" width="282" height="300" /></a></p>
<p>c．  输入网址后按Enter，程序连接服务器，窗口显示“暂挂中”，连接完毕后窗口会显示出可供安装的程序，选择CFEclipse CFML Editor   点 下一步</p>
<p>d．  点 完成  开始下载   出现安全警告提示软件未签名 点击确定  之后按提示重启flex builder</p>
<p>e．  打开工具窗口（Snip Tree View）；</p>
<p><a rel="attachment wp-att-659" href="http://blog.ityao.com/archives/665/attachment/003"><img class="alignnone size-full wp-image-659" src="http://blog.ityao.com/wp-content/uploads/2010/05/003.jpg" alt="" width="579" height="588" /></a></p>
<p>f．   编辑代码片断   新建片断<a rel="attachment wp-att-660" href="http://blog.ityao.com/archives/665/attachment/004"><img class="alignnone size-full wp-image-660" src="http://blog.ityao.com/wp-content/uploads/2010/05/004.jpg" alt="" width="17" height="19" /></a></p>
<p><a rel="attachment wp-att-661" href="http://blog.ityao.com/archives/665/attachment/005"><img class="alignnone size-full wp-image-661" src="http://blog.ityao.com/wp-content/uploads/2010/05/005.jpg" alt="" width="500" height="745" /></a></p>
<p>g．  <a rel="attachment wp-att-662" href="http://blog.ityao.com/archives/665/attachment/006"><img class="alignnone size-full wp-image-662" src="http://blog.ityao.com/wp-content/uploads/2010/05/006.jpg" alt="" width="22" height="24" /></a>按钮插入该片断（只适用于AS代码文件）</p>
<p>h．  片断中适用参量：$${    }   如图中代码</p>
<p><a rel="attachment wp-att-663" href="http://blog.ityao.com/archives/665/attachment/007"><img class="alignnone size-full wp-image-663" src="http://blog.ityao.com/wp-content/uploads/2010/05/007.jpg" alt="" width="491" height="741" /></a></p>
<p>在插入该片断时会出现提示框，要求输入$${}标记的参数值name  如图</p>
<p><a rel="attachment wp-att-664" href="http://blog.ityao.com/archives/665/attachment/008"><img class="alignnone size-full wp-image-664" src="http://blog.ityao.com/wp-content/uploads/2010/05/008.jpg" alt="" width="320" height="169" /></a></p>
<p>确定后整段代码被插入</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/665/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Air/Flex动态加载module及其依赖的RSL</title>
		<link>http://blog.ityao.com/archives/638</link>
		<comments>http://blog.ityao.com/archives/638#comments</comments>
		<pubDate>Wed, 05 May 2010 10:12:43 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[ADOBE RIA]]></category>

		<guid isPermaLink="false">http://blog.ityao.com/?p=638</guid>
		<description><![CDATA[有关Flex和Air中如何使用RSL网上教程很多，google一下即可，这里不多做叙述了 而这次遇到的问题是这样的： 发布时只发布一个主程序（Web或者Air方式），而不发布所需要的module及其依赖的swc，只在运行时根据需要加载module及其依赖的swc 1.       建立一个实验用的module工程： 先准备一个module工程，普通的Flex Project（web）即可，主程序名无所谓，因为这个工程只是为了编译module对象用的 在Properties-&#62;Flex Build Path中引入所要依赖的swc，这个例子中使用了TweenLite.swc 注意AIR project的默认Link Type是Merge into code，改成RSL。如图： 新建一个包modules并新建一个module程序：MyModule1.mxml 到Properties-&#62;Flex Modules中修改该module的optimize属性为none，如下图 点击Edit按钮，弹出下图 选择Do not optimize(…) 在MyModule1.xml中使用TweenLite做一个简单的动画: 编译工程， 此时MyModule1.mxml被编译生成为MyModule1.swf TweenLite.swc会被编译成TweenLite.swf 复制到要被加载的目录下，我的是 http://127.0.0.1/testflex/TweenLite.swf http://127.0.0.1/testflex/modules/MyModule1.swf 2.       建立主工程（Flex Web）： 新建一个Flex Project(web),不要使用引入TweenLite.swc 新建一个用来控制加载TweenLite的类： tasks/TaskLoadRSL.as 在这个类中，使用URLLoader将TweenLite.swc从http://127.0.0.1/testflex/TweenLite.swf上加载下来，主要代码如下： 加载完TweenLite后不需要任何操作，直接开始加载module即可 使用IModuleInfo或ModuleLoader加载module都可以，详见源代码 3.       建立主工程 （AIR）： Air中比Flex要麻烦，因为发布时只发布主程序，所以运行时需要先检测本地是否有swc和 module 如果有就直接加载运行（同Web） 如果没有就从网站上下载到本地，然后再加载 主要代码如下： 从网络地址上加载： 加载完，保存到本地： 本地加载过程同Flex Web 更多内容参加源代码：DynamicTestLoadModuleAndRSL]]></description>
			<content:encoded><![CDATA[<p>有关Flex和Air中如何使用RSL网上教程很多，google一下即可，这里不多做叙述了</p>
<h5>而这次遇到的问题是这样的：</h5>
<p>发布时只发布一个主程序（Web或者Air方式），而不发布所需要的module及其依赖的swc，只在运行时根据需要加载module及其依赖的swc</p>
<h6>1.       建立一个实验用的module工程：</h6>
<p>先准备一个module工程，普通的Flex Project（web）即可，主程序名无所谓，因为这个工程只是为了编译module对象用的</p>
<p>在Properties-&gt;Flex Build Path中引入所要依赖的swc，这个例子中使用了TweenLite.swc</p>
<p><strong>注意AIR project的默认</strong><strong>Link Type</strong><strong>是</strong><strong>Merge into code</strong><strong>，改成</strong><strong>RSL</strong><strong>。如图：</strong></p>
<p><strong><a rel="attachment wp-att-645" href="http://blog.ityao.com/archives/638/3-2"><img class="alignnone size-full wp-image-645" title="设置RSL" src="http://blog.ityao.com/wp-content/uploads/2010/05/3.jpg" alt="" width="892" height="385" /></a></strong></p>
<p>新建一个包modules并新建一个module程序：MyModule1.mxml</p>
<p>到Properties-&gt;Flex Modules中修改该module的optimize属性为none，如下图</p>
<p><a rel="attachment wp-att-644" href="http://blog.ityao.com/archives/638/1-5"><img class="alignnone size-full wp-image-644" title="编辑module属性" src="http://blog.ityao.com/wp-content/uploads/2010/05/11.jpg" alt="" width="950" height="274" /></a></p>
<p>点击Edit按钮，弹出下图</p>
<p><a rel="attachment wp-att-643" href="http://blog.ityao.com/archives/638/2-5"><img class="alignnone size-full wp-image-643" title="设置module属性" src="http://blog.ityao.com/wp-content/uploads/2010/05/2.jpg" alt="" width="502" height="298" /></a></p>
<p>选择Do not optimize(…)</p>
<p>在MyModule1.xml中使用TweenLite做一个简单的动画:</p>
<pre class="brush: plain; title: ; notranslate">TweenLite.to(&lt;strong&gt;this&lt;/strong&gt;.goed,4,{x:500});</pre>
<p>编译工程，</p>
<p>此时MyModule1.mxml被编译生成为MyModule1.swf</p>
<p>TweenLite.swc会被编译成TweenLite.swf</p>
<p>复制到要被加载的目录下，我的是</p>
<p>http://127.0.0.1/testflex/TweenLite.swf</p>
<p>http://127.0.0.1/testflex/modules/MyModule1.swf</p>
<h6>2.       建立主工程（Flex Web）：</h6>
<p>新建一个Flex Project(web),不要使用引入TweenLite.swc</p>
<p>新建一个用来控制加载TweenLite的类：</p>
<p>tasks/TaskLoadRSL.as</p>
<p>在这个类中，使用URLLoader将TweenLite.swc从<a href="http://127.0.0.1/testflex/TweenLite.swf">http://127.0.0.1/testflex/TweenLite.swf</a>上加载下来，主要代码如下：</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<pre class="brush: plain; title: ; notranslate">var loader:Loader = new Loader();
var context:LoaderContext = new LoaderContext();
context.applicationDomain = ApplicationDomain.currentDomain;//必须有这一句，RSL必须和主程序在同一个域中
loader.load(new URLRequest(this.web),context);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,localLoadCompleteHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,localLoadIoErrorHandler);
</pre>
<p>加载完TweenLite后不需要任何操作，直接开始加载module即可</p>
<p>使用IModuleInfo或ModuleLoader加载module都可以，详见源代码</p>
<h6>3.       建立主工程 （AIR）：</h6>
<p>Air中比Flex要麻烦，因为发布时只发布主程序，所以运行时需要先检测本地是否有swc和</p>
<p>module</p>
<p>如果有就直接加载运行（同Web）</p>
<p>如果没有就从网站上下载到本地，然后再加载</p>
<p>主要代码如下：</p>
<p>从网络地址上加载：</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>
<pre class="brush: plain; title: ; notranslate">var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, loadFromWebCompleteHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, loadFromWebErrorHandler);
loader.load(new URLRequest(web))
</pre>
<p>加载完，保存到本地：</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>
<pre class="brush: plain; title: ; notranslate">var loader:URLLoader = URLLoader($e.target);
var data:ByteArray = ByteArray(loader.data);
var file:File = new File(File.applicationDirectory.resolvePath(this.local).nativePath);
trace('save file to' + file.nativePath);
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.WRITE);
fileStream.writeBytes(data);
fileStream.close();
this.loadFromLocalFile();
</pre>
<p>本地加载过程同Flex Web</p>
<p>更多内容参加<a rel="attachment wp-att-648" href="http://blog.ityao.com/archives/638/dynamictestloadmoduleandrsl">源代码：DynamicTestLoadModuleAndRSL</a></p>
<p></strong></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ityao.com/archives/638/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

