<?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>Li Guoliang &#187; AIR</title>
	<atom:link href="http://liguoliang.com/tag/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://liguoliang.com</link>
	<description>ActionScript Flex Java JEE PHP...</description>
	<lastBuildDate>Mon, 21 May 2012 17:04:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Adobe Labs发布Flash Player 11.2 Beta for desktops 及AIR 3.2 Beta</title>
		<link>http://liguoliang.com/2011/adobe-labs-flash-player-11-2-bet%e5%8f%8aair-3-2beta/</link>
		<comments>http://liguoliang.com/2011/adobe-labs-flash-player-11-2-bet%e5%8f%8aair-3-2beta/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 07:10:51 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe Labs]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash Player]]></category>

		<guid isPermaLink="false">http://liguoliang.com/?p=2152</guid>
		<description><![CDATA[主要针对视频解码的多线程支持:
<strong>Multi-threaded video decoding</strong> (Windows, Mac OS, and Linux) — The video decoding pipeline is now fully multi-threaded. This feature sho<p class='read-more'><a href='http://liguoliang.com/2011/adobe-labs-flash-player-11-2-bet%e5%8f%8aair-3-2beta/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p>主要针对视频解码的多线程支持:</p>
<p><strong>Multi-threaded video decoding</strong> (Windows, Mac OS, and Linux) — The video decoding pipeline is now fully multi-threaded. This feature should improve the overall performance on all platforms. Note that this feature is a significant architecture change required for other future improvements.</p>
<p><strong>Flash Player background updates</strong> (Windows) — New versions of the runtimes can now be delivered more effectively to the end user with this enhanced updating mechanism (Background update is only available in the release versions of Flash Player).</p>
<p>More info: <a href="http://labs.adobe.com/technologies/flashplatformruntimes/flashplayer11-2/">http://labs.adobe.com/technologies/flashplatformruntimes/flashplayer11-2/</a></p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2011/adobe-labs-flash-player-11-2-bet%e5%8f%8aair-3-2beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR Error: invalid application descriptor: Unknown namespace/ versionNumber must have a non-empty value.</title>
		<link>http://liguoliang.com/2011/air-error-invalid-application-descriptor-unknown-namespace-versionnumber-must-have-a-non-empty-value/</link>
		<comments>http://liguoliang.com/2011/air-error-invalid-application-descriptor-unknown-namespace-versionnumber-must-have-a-non-empty-value/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 07:26:06 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2011/air-error-invalid-application-descriptor-unknown-namespace-versionnumber-must-have-a-non-empty-value/</guid>
		<description><![CDATA[Adobe AIR 最近一年升级火速, 去年1.5.3创建的Project使用高版本的SDK后会因为配置文件引发各类错误, 譬如:
<strong>Error1</strong>:&#160; Namespace 1.5.3 in the application descriptor file should be equal or <p class='read-more'><a href='http://liguoliang.com/2011/air-error-invalid-application-descriptor-unknown-namespace-versionnumber-must-have-a-non-empty-value/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Adobe AIR 最近一年升级火速, 去年1.5.3创建的Project使用高版本的SDK后会因为配置文件引发各类错误, 譬如:</p>
<p><strong>Error1</strong>:&nbsp; Namespace 1.5.3 in the application descriptor file should be equal or higher than the minimum version 2.6.0 required by Flex SDK.&nbsp;&nbsp;&nbsp; </p>
<p>OK, 那替换1.5.3为2.6.0:</p>
<p>Process terminated without establishing connection to debugger.<br />invalid application descriptor: Unknown namespace: <a href="http://ns.adobe.com/air/application/2.6.0">http://ns.adobe.com/air/application/2.6.0</a></p>
<p>Ok, 看来2.6.0只是个提示信息, 并不存在2.6.0这个命名空间, 于是参考新的Project, <strong>修改为2.6;</strong></p>
<p>继续尝试, 错误又来:</p>
<p><strong>Error2:</strong> Process terminated without establishing connection to debugger.<br />invalid application descriptor: versionNumber must have a non-empty value.
<p>Ok, 结构变化了, versionNumber 这个必须要有, 增加一下:
<pre>

&lt;versionNumber&gt;0.0.0&lt;/versionNumber&gt; 
</pre>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2011/air-error-invalid-application-descriptor-unknown-namespace-versionnumber-must-have-a-non-empty-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在线安装AIR 及 Error# 2032错误解决方法</title>
		<link>http://liguoliang.com/2009/%e5%9c%a8%e7%ba%bf%e5%ae%89%e8%a3%85air-%e5%8f%8a-error-2032%e9%94%99%e8%af%af%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/</link>
		<comments>http://liguoliang.com/2009/%e5%9c%a8%e7%ba%bf%e5%ae%89%e8%a3%85air-%e5%8f%8a-error-2032%e9%94%99%e8%af%af%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 15:33:54 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AIR发布]]></category>
		<category><![CDATA[AIR网页安装]]></category>
		<category><![CDATA[Error #2032]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2009/03/818/</guid>
		<description><![CDATA[找到．．．\sdks\3.2.0\samples的badge目录，修改default_badge.html文件：
AC_FL_RunContent(
		'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swf<p class='read-more'><a href='http://liguoliang.com/2009/%e5%9c%a8%e7%ba%bf%e5%ae%89%e8%a3%85air-%e5%8f%8a-error-2032%e9%94%99%e8%af%af%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p>找到．．．\sdks\3.2.0\samples的badge目录，修改default_badge.html文件：</p>
<pre class="java">AC_FL_RunContent(
		'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab',
		'width','217',
		'height','180',
		'id','badge',
		'align','middle',
		'src','badge',
		'quality','high',
		'bgcolor','#FFFFFF',
		'name','badge',
		'allowscriptaccess','all',
		'pluginspage','http://www.macromedia.com/go/getflashplayer',
		'flashvars','appname=My%20Application&amp;appurl=myapp.air&amp;airversion=1.0&amp;imageurl=test.jpg',
		'movie','badge' ); //end AC code

}</pre>
<p>注意上面的appurl, 不要搞错. 发布该网页, OK.</p>
<p>如果出现</p>
<p><a href="http://liguoliang.com/wp-content/uploads/2009/03/image.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://liguoliang.com/wp-content/uploads/2009/03/image-thumb.png" border="0" alt="image" width="260" height="135" /></a></p>
<p>将路径补充完整或修改.htaccess文件都可 最简单的:</p>
<p>&#8216;flashvars&#8217;,'appname=NM&amp;appurl=<strong>http://liguoliang.com/test/NM.air</strong>&amp;airversion=1.0&amp;imageurl=test.jpg&#8217;,</p>
<p>搞定.</p>
<p>Look: http://liguoliang.com/test/default_badge.html</p>
<p>AIR文档中相关内容 <a href="http://help.adobe.com/zh_CN/AIR/1.1/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7e15.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7c87" target="_blank">&gt;&gt;点此&lt;&lt;</a></p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2009/%e5%9c%a8%e7%ba%bf%e5%ae%89%e8%a3%85air-%e5%8f%8a-error-2032%e9%94%99%e8%af%af%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR中通过右键直接选定基于LIST容器[DataGrid, List, Tree等]的数据 &#8211; Select List item with mouse right-click</title>
		<link>http://liguoliang.com/2009/air%e4%b8%ad%e9%80%9a%e8%bf%87%e5%8f%b3%e9%94%ae%e7%9b%b4%e6%8e%a5%e9%80%89%e5%ae%9a%e5%9f%ba%e4%ba%8elist%e5%ae%b9%e5%99%a8datagrid-list-tree%e7%ad%89%e7%9a%84%e6%95%b0%e6%8d%ae-select-list-ite/</link>
		<comments>http://liguoliang.com/2009/air%e4%b8%ad%e9%80%9a%e8%bf%87%e5%8f%b3%e9%94%ae%e7%9b%b4%e6%8e%a5%e9%80%89%e5%ae%9a%e5%9f%ba%e4%ba%8elist%e5%ae%b9%e5%99%a8datagrid-list-tree%e7%ad%89%e7%9a%84%e6%95%b0%e6%8d%ae-select-list-ite/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 15:18:16 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Air右键]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[Flex右键]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[Tree]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2009/01/675/</guid>
		<description><![CDATA[在很多情况下, 我们在DataGrid, List, Tree等容器中使用右键, 进行如修改, 删除 某行的操作.  问题是如果该容器初始状态下直接进行右键点击时, 并不能选定任何数据. 通过监听右键菜单SELECT事件, 获取到当前右键所击位置的Index, 并将之赋值给DataGrid或其他容器的SelectIndex, 完成点击操作<p class='read-more'><a href='http://liguoliang.com/2009/air%e4%b8%ad%e9%80%9a%e8%bf%87%e5%8f%b3%e9%94%ae%e7%9b%b4%e6%8e%a5%e9%80%89%e5%ae%9a%e5%9f%ba%e4%ba%8elist%e5%ae%b9%e5%99%a8datagrid-list-tree%e7%ad%89%e7%9a%84%e6%95%b0%e6%8d%ae-select-list-ite/'></a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p><strong>问题:</strong> 在很多情况下, 我们在DataGrid, List, Tree等容器中使用右键, 进行如修改, 删除 某行的操作.&#160; 问题是如果该容器初始状态下直接进行右键点击时, 并不能选定任何数据. </p>
<p><strong>解决: </strong>通过监听右键菜单SELECT事件, 获取到当前右键所击位置的Index, 并将之赋值给DataGrid或其他容器的SelectIndex, 完成点击操作</p>
<p><strong>详细实现:&#160; </strong>以DataGrid为例.</p>
<p>第一步, 首先给DataGrid添加菜单</p>
<pre class="java" name="code">			var dgMenu:NativeMenu = new NativeMenu();
			var del:NativeMenuItem  = new NativeMenuItem(&quot;Test&quot;);
			del.addEventListener(Event.SELECT, onRightClickDel);
			dgMenu.addItem(del);
			dgMenu.addEventListener(ContextMenuEvent.MENU_SELECT, onRightClicked);
			_dataGridStudent.contextMenu = dgMenu;</pre>
<p>第二步, 响应函数:</p>
<pre class="java" name="code">	/**响应右键点击 */
	private function onRightClicked(e:ContextMenuEvent):void {
		var rightClickItemRender:IListItemRenderer;

		if(e.mouseTarget is IListItemRenderer) {
			rightClickItemRender = IListItemRenderer(e.mouseTarget);
		}else if(e.mouseTarget.parent is IListItemRenderer) {
			rightClickItemRender = IListItemRenderer(e.mouseTarget.parent);
		}

		if(rightClickItemRender != null) {
			var rightClickIndex:int = _dataGridStudent.itemRendererToIndex(rightClickItemRender);
			if(_dataGridStudent.selectedIndex != rightClickIndex) {
				_dataGridStudent.selectedIndex = rightClickIndex;
				onSlectedChange();
			}
		}
		trace(&quot;通过右键单击获得选定的行: &quot; + _dataGridStudent.selectedIndex);
	}</pre>
<p>Delete响应函数:</p>
<pre class="java" name="code">	/** 当右键菜单的Delete点击后响应*/
	private function onRightClickDel(e:Event):void {
		//在这里放逻辑....
	}</pre>
<p><strong>效果:</strong></p>
<p><a href="http://liguoliang.com/wp-content/uploads/2009/01/image2.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="313" alt="image" src="http://liguoliang.com/wp-content/uploads/2009/01/image-thumb2.png" width="390" border="0" /></a> </p>
<p>控制台Trace信息:</p>
<p><em>通过右键单击获得选定的行: 1</em></p>
</p>
<p>&#160;</p>
<p>参考资料: <a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&amp;postId=11606&amp;productId=2&amp;loc=en_US" target="_blank">Adobe CookBook&#160; Select List item with mouse right-click</a></p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2009/air%e4%b8%ad%e9%80%9a%e8%bf%87%e5%8f%b3%e9%94%ae%e7%9b%b4%e6%8e%a5%e9%80%89%e5%ae%9a%e5%9f%ba%e4%ba%8elist%e5%ae%b9%e5%99%a8datagrid-list-tree%e7%ad%89%e7%9a%84%e6%95%b0%e6%8d%ae-select-list-ite/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>AIR中使用:程序菜单,上下文菜单,右键菜单</title>
		<link>http://liguoliang.com/2008/air%e4%b8%ad%e4%bd%bf%e7%94%a8%e7%a8%8b%e5%ba%8f%e8%8f%9c%e5%8d%95%e4%b8%8a%e4%b8%8b%e6%96%87%e8%8f%9c%e5%8d%95%e5%8f%b3%e9%94%ae%e8%8f%9c%e5%8d%95-use-window-menus-context-menus-pop-up-menus-in/</link>
		<comments>http://liguoliang.com/2008/air%e4%b8%ad%e4%bd%bf%e7%94%a8%e7%a8%8b%e5%ba%8f%e8%8f%9c%e5%8d%95%e4%b8%8a%e4%b8%8b%e6%96%87%e8%8f%9c%e5%8d%95%e5%8f%b3%e9%94%ae%e8%8f%9c%e5%8d%95-use-window-menus-context-menus-pop-up-menus-in/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 03:51:49 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2008/10/279/</guid>
		<description><![CDATA[与窗口一样, 在一个AIR应用中, 菜单也是不可或缺的.
虽然在AIR中菜单有多种实现方式, 但是所有的Menu都是相同的,只是其实现方式不同而已,因此, 我们建立一个菜单, 使用不同的方式实现:    
var menuFile:NativeMenu = new NativeMenu();
//如<p class='read-more'><a href='http://liguoliang.com/2008/air%e4%b8%ad%e4%bd%bf%e7%94%a8%e7%a8%8b%e5%ba%8f%e8%8f%9c%e5%8d%95%e4%b8%8a%e4%b8%8b%e6%96%87%e8%8f%9c%e5%8d%95%e5%8f%b3%e9%94%ae%e8%8f%9c%e5%8d%95-use-window-menus-context-menus-pop-up-menus-in/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p>与窗口一样, 在一个AIR应用中, 菜单也是不可或缺的.</p>
<p>虽然在AIR中菜单有多种实现方式, 但是所有的Menu都是相同的,只是其实现方式不同而已,因此, 我们建立一个菜单, 使用不同的方式实现:    </p>
<pre class="java" name="code">var menuFile:NativeMenu = new NativeMenu();
//如果需要在选择save时进行处理,则监听Event.SELECT事件, 如:save.addEventListener
var save:NativeMenuItem = new NativeMenuItem(&quot;Save&quot;);
var close:NativeMenuItem = new NativeMenuItem(&quot;Close&quot;);
menuFile.items = [save, close];</pre>
<h4>1. Window Menus [Windows平台下]</h4>
<p>在苹果里叫做application menus, 不过本质都是相同的NativeMenu. 没有苹果机, 只说说Windows下的Window Menus. 当然也可以检查系统是否支持NativeMenu,或是application menus, 如:<br />
  <br />if(NativeWindow.supportsMenu) ; </p>
<p>注意: 如果要在窗口中使用Window Menus , 他的配置文件或属性中systemChrome必须设置为&quot;standard&quot;,否则将在编译时发生错误. </p>
<p></p>
<p>Window Menus的实现: </p>
<pre class="java" name="code"> if(NativeWindow.supportsMenu) { //检测是否支持Window menu
	var mainMenu:NativeMenu = new NativeMenu();
	mainMenu.addSubmenu(menuFile,&quot;File&quot;); //加入子菜单
	nativeWindow.menu = mainMenu; //将菜单加入到程序中.
}	</pre>
<p>效果: </p>
<p><a href="http://liguoliang.com/wp-content/uploads/2008/10/image17.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="176" alt="image" src="http://liguoliang.com/wp-content/uploads/2008/10/image-thumb17.png" width="179" border="0" /></a> </p>
<h4>2.Context Menus 上下文菜单</h4>
<p>我们可以给AIR程序中的Flash或基于Flash的对象设置Context Menu. 注意:<br />
  <br />1. 在AIR中, Context Menu是 NativeMenu的实例, 而在Web应用中[Flex], 它是ContextMenu的实例 </p>
<p>2. Context Menu可以在AIR应用之上或超出其范围显示. 它是系统级别的.</p>
<p>Context Menu的实现:<br />
  <br />buttonOpen.contextMenu = menuFile;</p>
<p>效果:</p>
<p><a href="http://liguoliang.com/wp-content/uploads/2008/10/image19.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="188" alt="image" src="http://liguoliang.com/wp-content/uploads/2008/10/image-thumb18.png" width="200" border="0" /></a> </p>
<h3>3.Pop-Up Menus</h3>
<p>你可以通过编程方式在任何时候使用Pop-Up Menus, 一般情况下,在用户按下某个键, 或是点击鼠标后弹出Pop-UpMenus. 不论是何种方式, 只需要运行NativeMenu实例的display()方法,将Pop-Up Menu显示便可.</p>
<p>监听textInput的右键Down事件: </p>
<pre class="java" name="code">textInput.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, onTextInputClicked);</pre>
<p>该事件的响应函数,将会阻止在textInput中右键的默认菜单, 将其菜单换做上面我们定义的menuFile. 该响应函数如下: </p>
<pre class="java" name="code">private function onTextInputClicked(e:MouseEvent):void {
	e.preventDefault();
		menuFile.display(stage, mouseX, mouseY);
}</pre>
<p>效果： </p>
<p><a href="http://liguoliang.com/wp-content/uploads/2008/10/image20.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="204" alt="image" src="http://liguoliang.com/wp-content/uploads/2008/10/image-thumb19.png" width="192" border="0" /></a></p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2008/air%e4%b8%ad%e4%bd%bf%e7%94%a8%e7%a8%8b%e5%ba%8f%e8%8f%9c%e5%8d%95%e4%b8%8a%e4%b8%8b%e6%96%87%e8%8f%9c%e5%8d%95%e5%8f%b3%e9%94%ae%e8%8f%9c%e5%8d%95-use-window-menus-context-menus-pop-up-menus-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR中关闭所有打开的窗口</title>
		<link>http://liguoliang.com/2008/air%e4%b8%ad%e5%85%b3%e9%97%ad%e6%89%80%e6%9c%89%e6%89%93%e5%bc%80%e7%9a%84%e7%aa%97%e5%8f%a3-close-all-opened-windows-in-air/</link>
		<comments>http://liguoliang.com/2008/air%e4%b8%ad%e5%85%b3%e9%97%ad%e6%89%80%e6%9c%89%e6%89%93%e5%bc%80%e7%9a%84%e7%aa%97%e5%8f%a3-close-all-opened-windows-in-air/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 02:18:34 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2008/10/271/</guid>
		<description><![CDATA[在AIR工程中, 如果新建某个窗口, 当关闭主窗口时, 新窗口并不随着主窗口的关闭而关闭, 但是在很多情况下. 我们需要在主窗口关闭时, 所有的子窗口都一起关闭. 
为了达到这个效果, 我们监听主窗口的Event.CLOSING事件, 当用户点击主窗口关闭按钮或是单击任务栏右键时, 我们采取一定措施<p class='read-more'><a href='http://liguoliang.com/2008/air%e4%b8%ad%e5%85%b3%e9%97%ad%e6%89%80%e6%9c%89%e6%89%93%e5%bc%80%e7%9a%84%e7%aa%97%e5%8f%a3-close-all-opened-windows-in-air/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p>在AIR工程中, 如果新建某个窗口, 当关闭主窗口时, 新窗口并不随着主窗口的关闭而关闭, 但是在很多情况下. 我们需要在主窗口关闭时, 所有的子窗口都一起关闭. </p>
<p>为了达到这个效果, 我们监听主窗口的Event.CLOSING事件, 当用户点击主窗口关闭按钮或是单击任务栏右键时, 我们采取一定措施, 关闭所有窗口.</p>
<p>在AIR中,openedWindows是一个包括了所有当前打开的窗口滴数组. 因此遍历该数组,将所有元素都关闭便可达到目的.</p>
<p>故Event.CLOSING的监听函数可以这么写:</p>
<pre class="java" name="code">
/**主窗口点击关闭时,关闭所有打开的窗口*/
private function onMainWindowClose(e:Event):void {
	var wds:Array = NativeApplication.nativeApplication.openedWindows;
	for (var i:int = 0; i<wds.length; i++) {
		windows[i].close();    //遍历数组,关闭所有当前打开的窗口
	}
}
</pre>
<p>运行代码，点击主窗口关闭按钮或是任务栏右键关闭时，所有窗口都将关闭．</p>
<p>另外,如果仅需要关闭主窗口之外的所有窗口, 可以在for循环结束之后增加e.preventDefault()，同时for循环修改为:</p>
<pre class="java" name="code">
for (var i:int = 1; i<windows.length; i++)
</pre>
<p>以阻止主窗口关闭，达到关闭其他窗口，保留主窗口的目的．
</p>
</pre>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2008/air%e4%b8%ad%e5%85%b3%e9%97%ad%e6%89%80%e6%9c%89%e6%89%93%e5%bc%80%e7%9a%84%e7%aa%97%e5%8f%a3-close-all-opened-windows-in-air/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AIR中窗口的关闭</title>
		<link>http://liguoliang.com/2008/air%e4%b8%ad%e7%aa%97%e5%8f%a3%e7%9a%84%e5%85%b3%e9%97%ad-close-window-in-air-application/</link>
		<comments>http://liguoliang.com/2008/air%e4%b8%ad%e7%aa%97%e5%8f%a3%e7%9a%84%e5%85%b3%e9%97%ad-close-window-in-air-application/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 02:00:12 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2008/10/268/</guid>
		<description><![CDATA[在默认情况下, AIR程序中已经被关闭的窗口不可以再次打开的.因此我们通过visible属性 来模拟打开关闭[ 没有关闭, 只是隐藏]:
以下代码新建了一个窗口, 并监听Event.CLOSING事件, 阻止默认行为, 使得用户在点击关闭窗口时,窗口只隐藏而不关闭, 当用户再次点击主窗口的&#822<p class='read-more'><a href='http://liguoliang.com/2008/air%e4%b8%ad%e7%aa%97%e5%8f%a3%e7%9a%84%e5%85%b3%e9%97%ad-close-window-in-air-application/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p>在默认情况下, AIR程序中已经被关闭的窗口不可以再次打开的.因此我们通过visible属性 来模拟打开关闭[ 没有关闭, 只是隐藏]:</p>
<p>以下代码新建了一个窗口, 并监听Event.CLOSING事件, 阻止默认行为, 使得用户在点击关闭窗口时,窗口只隐藏而不关闭, 当用户再次点击主窗口的&#8221;OPEN&#8221;时, 该新窗口又会出现,.</p>
<pre class="java" name="code">import mx.messaging.AbstractConsumer;
import mx.events.AIREvent;
import mx.controls.Button;
import mx.core.Window;
private var newWindow:Window;
/**初始化*/
private function init():void {
title = "Main Window"; //设定标题栏显示的名称
addNewWindow();	//增加一个新窗口
//增加一个Button
var buttonOpen:Button = new Button();
buttonOpen.label = "OPEN";
buttonOpen.addEventListener(MouseEvent.CLICK, onOpenButtonClicked);
addChild(buttonOpen);
}

/**创建新窗口并打开*/
private function addNewWindow():void {
	newWindow = new Window();
	newWindow.width = 200;
	newWindow.height = 200;
	newWindow.title = "New Winidow Test";
	newWindow.type = NativeWindowType.UTILITY //设定类型
	newWindow.systemChrome = "none"; //去除系统自带的框架与标题栏
	//监听AIREvent.WINDOW_COMPLETE函数,当创建完毕后执行onWindowComplete
	newWindow.addEventListener(AIREvent.WINDOW_COMPLETE, onWindowComplete);
	//监听Event.CLOSING,当用户点击关闭时,呼叫onClose
	newWindow.addEventListener(Event.CLOSING, onClose);
	newWindow.open();
}

/**创建完毕后的响应函数, 用于设定新窗口的位置*/
private function onWindowComplete(e:AIREvent):void {
	e.target.stage.nativeWindow.x = (Capabilities.screenResolutionX -  e.target.stage.nativeWindow.width)/2;
	e.target.stage.nativeWindow.y = (Capabilities.screenResolutionY - e.target.stage.nativeWindow.height)/2;
}

/**当主窗口的"OPEN"点击后,执行该函数,将新窗口重新设置为active,看起来便是关闭后,点击"OPEN"将新窗口从新打开*/
private function onOpenButtonClicked(e:MouseEvent):void {
	newWindow.activate();
}

/**当点击关闭后,将窗口设为不可见,同时阻止默认行为的发生*/
private function onClose(e:Event):void {
	e.preventDefault();
	newWindow.visible = false;
}</pre>
<p>在一个MXML初始化时执行以上代码,变可出现以下结果:</p>
<p><a href="http://liguoliang.com/wp-content/uploads/2008/10/image16.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://liguoliang.com/wp-content/uploads/2008/10/image-thumb16.png" border="0" alt="image" width="244" height="145" /></a></p>
<p>点击新窗口关闭按钮时, 新窗口仅仅隐藏起来, 点击主窗口的&#8221;OPEN&#8221;时,将使得新窗口重新Active.</p>
<p>提示:</p>
<p>1.要监听Event.CLOSING事件, 不要搞成Event.CLOSE事件了&#8230;.[最近表达能力有点小欠缺, 描述不清楚, 只好用"搞"]&#8230;</p>
<p>2. 主窗口不使用系统自带的框架与标题栏, 须在配置文件中设定  详见上一篇文章&#8230; 新窗口使用newWindow.systemChrome = &#8220;none&#8221;; 便可完成该效果.</p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2008/air%e4%b8%ad%e7%aa%97%e5%8f%a3%e7%9a%84%e5%85%b3%e9%97%ad-close-window-in-air-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>略微总结下Air工程中的xml配置[描述]文件</title>
		<link>http://liguoliang.com/2008/%e7%95%a5%e5%be%ae%e6%80%bb%e7%bb%93%e4%b8%8bair%e5%b7%a5%e7%a8%8b%e4%b8%ad%e7%9a%84xml%e9%85%8d%e7%bd%ae%e6%8f%8f%e8%bf%b0%e6%96%87%e4%bb%b6/</link>
		<comments>http://liguoliang.com/2008/%e7%95%a5%e5%be%ae%e6%80%bb%e7%bb%93%e4%b8%8bair%e5%b7%a5%e7%a8%8b%e4%b8%ad%e7%9a%84xml%e9%85%8d%e7%bd%ae%e6%8f%8f%e8%bf%b0%e6%96%87%e4%bb%b6/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 15:55:11 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2008/10/264/</guid>
		<description><![CDATA[在Flex Builder中新建一个Air工程会自动产生一个对应的配置文件,[也许叫做描述文件会更加确切],&#160; 如新建一个名为&#34;AIRTest&#34;的工程, 则会产生一个&#34;AIRTest-app.xml&#34;的配置文件.&#160; 本文略加总结,&#160<p class='read-more'><a href='http://liguoliang.com/2008/%e7%95%a5%e5%be%ae%e6%80%bb%e7%bb%93%e4%b8%8bair%e5%b7%a5%e7%a8%8b%e4%b8%ad%e7%9a%84xml%e9%85%8d%e7%bd%ae%e6%8f%8f%e8%bf%b0%e6%96%87%e4%bb%b6/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<p>在Flex Builder中新建一个Air工程会自动产生一个对应的配置文件,[也许叫做描述文件会更加确切],&#160; 如新建一个名为&quot;AIRTest&quot;的工程, 则会产生一个&quot;AIRTest-app.xml&quot;的配置文件.&#160; 本文略加总结,&#160; 以稍事整理下自己有点小杂乱的思路:</p>
<p>当你在打包发布Air工程时, 就会用到该文件来提供一些信息. 这些信息包括但不限於:&#160; 该程序的一个唯一的ID, 版本, 安装时的显示信息等.</p>
<p>捡几个重要的说说:</p>
<p>1. [必须]application标签: 必须的, 是该配置文件的Root, 对于Air 1.1来说, 命名空间为:<a title="http://ns.adobe.com/air/application/1.1&quot;" href="http://ns.adobe.com/air/application/1.1&quot;">http://ns.adobe.com/air/application/1.1&quot;</a>, 每一个版本的Air都有一个单独的命名空间. 其他的标签作为子标签嵌入在application中.</p>
<p>2.[必须]id标签: 指定该程序一个唯一的ID, 只有带有ID属性的Air程序才能被安装,.程序的ID由发布者的ID与id标签中指定的id组合而成.</p>
<p>3.[必须]filename标签: 指定生成的.air文件的名称</p>
<p>4.[可选]name标签: 用于指定AIR程序安装的默认目录, 当程序运行时第一屏显示中标题栏现实的标题, 如果不指定name的属性, 则使用filename代替.</p>
<p>5.[必须]version 标签:&#160; Air不会对version进行任何干预或是操作, 完全由用户来控制,因此可以使用任何String来做为Verion, 如 1.0 , 2.5.1, 4.0a等</p>
<p>6.[可选]description: 安装时显示的描述</p>
<p>7.[可选]copyright: 版权信息</p>
<p>8.[必须]initialWindow标签: initialWindow标签属性为AIR程序指定实质性的内容, initialWindow下面有很多子标签, 但只有content是必须的. content用来描述AIR程序必须的.swf或.html文件.   <br />&#160;&#160;&#160; [可选]systemChrome标签: 是否使用系统提供的框架与标题栏, 默认值为&quot;standard&quot;, 如果需要AIR程序去掉操作系统自带的标题栏等, 设置为&quot;none&quot;便可.    <br />&#160;&#160;&#160; [可选]transparent<strong>:</strong> 设定程序是否透明, 默认值为true, 但首要条件是systemChrome设置为none    <br />&#160;&#160; [可选]visible: 初始化时是否可见..&#160; 在你调整好程序的定位或是其他属性之后, 可以通过代码再设置为ture.    <br />&#160;&#160; [可选]minimizable, maximizable, resizable, 是否可以最小化,最大化, 调整大小. 默认都为true.    <br />&#160;&#160;&#160; [可选]width, height, 窗口的大小    <br />&#160;&#160;&#160; [可选]x,y: 程序的定位,左上角    <br />&#160;&#160;&#160; [可选]minSize, maxSize: 程序最小化,最大化后的窗口大小: 如: 400 200;    <br />9. [可选]installFolder:&#160; 我们无法更改程序安装默认主目录[在Windows下, 为系统盘下的\Program Files], 只能通过installFolder设置该默认主目录下的子目录.</p>
<p>10.[可选]programMenuFolder 程序安装成功后, 在Windows开始菜单 所有程序中的文件夹; 在其他操作系统中将忽略该属性</p>
<p>11. [可选]icon 定义在桌面快捷方式, 快速启动栏, 缩略图等模式下的图像</p>
<p>12. [可选]customUpdateUI 设置为false时由AIR application installer来自动进行升级,无须用户干预, 设置为true时, 将弹出标准的AIR更新对话框.</p>
<p>13.[可选]allowBrowserInvocation: 是否允许用户通过浏览器中的连接来访问AIR程序. 默认为false</p>
<p>14.[可选] fileTypes: 注册AIR程序打开的某类文件.</p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2008/%e7%95%a5%e5%be%ae%e6%80%bb%e7%bb%93%e4%b8%8bair%e5%b7%a5%e7%a8%8b%e4%b8%ad%e7%9a%84xml%e9%85%8d%e7%bd%ae%e6%8f%8f%e8%bf%b0%e6%96%87%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Air中新建窗口 Create New Window In Air</title>
		<link>http://liguoliang.com/2008/air%e4%b8%ad%e6%96%b0%e5%bb%ba%e7%aa%97%e5%8f%a3-create-new-window-in-air/</link>
		<comments>http://liguoliang.com/2008/air%e4%b8%ad%e6%96%b0%e5%bb%ba%e7%aa%97%e5%8f%a3-create-new-window-in-air/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 09:16:55 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2008/10/263/</guid>
		<description><![CDATA[问题：在Air中新建一个窗口
代码实现:
在app初始化时执行以下函数,将新建并添加一个名为&#34;New Winidow Test&#34;,长宽分别为200的窗口:
private function init():void {
	newWindow = new Window();
	new<p class='read-more'><a href='http://liguoliang.com/2008/air%e4%b8%ad%e6%96%b0%e5%bb%ba%e7%aa%97%e5%8f%a3-create-new-window-in-air/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<h2>问题：在Air中新建一个窗口</h2>
<h2>代码实现:</h2>
<p>在app初始化时执行以下函数,将新建并添加一个名为&quot;New Winidow Test&quot;,长宽分别为200的窗口:</p>
<pre class="java" name="code">private function init():void {
	newWindow = new Window();
	newWindow.width = 200;
	newWindow.height = 200;
	newWindow.title = &quot;New Winidow Test&quot;;
	newWindow.systemChrome = &quot;none&quot;;
	newWindow.type = NativeWindowType.UTILITY
	newWindow.open();
}</pre>
<p>如果需要设定该窗口的显示位置, 可通过监听AIREvent.WINDOW_COMPLETE事件来进行x,y的设定.</p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2008/air%e4%b8%ad%e6%96%b0%e5%bb%ba%e7%aa%97%e5%8f%a3-create-new-window-in-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript中使用自定义组件 Use CustomUI in Flex with ActionScript</title>
		<link>http://liguoliang.com/2008/actionscript%e4%b8%ad%e4%bd%bf%e7%94%a8%e8%87%aa%e5%ae%9a%e4%b9%89%e7%bb%84%e4%bb%b6-use-customui-in-flex-with-actionscript/</link>
		<comments>http://liguoliang.com/2008/actionscript%e4%b8%ad%e4%bd%bf%e7%94%a8%e8%87%aa%e5%ae%9a%e4%b9%89%e7%bb%84%e4%bb%b6-use-customui-in-flex-with-actionscript/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 03:12:30 +0000</pubDate>
		<dc:creator>Guoliang</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[itemEditor]]></category>

		<guid isPermaLink="false">http://liguoliang.com/2008/10/251/</guid>
		<description><![CDATA[一: 需求
要求使用get ui获得一个UICompontent[DataGrid], 其中DataGrid某列的ItemEditor为ComboBox,且该UICompontent的右键菜单中有一个Item: 删除 [删除当前选定的行]    使用set value 来设定该UIComponten<p class='read-more'><a href='http://liguoliang.com/2008/actionscript%e4%b8%ad%e4%bd%bf%e7%94%a8%e8%87%aa%e5%ae%9a%e4%b9%89%e7%bb%84%e4%bb%b6-use-customui-in-flex-with-actionscript/'>More...</a></p><p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></description>
			<content:encoded><![CDATA[<h3>一: 需求</h3>
<p>要求使用get ui获得一个UICompontent[DataGrid], 其中DataGrid某列的ItemEditor为ComboBox,且该UICompontent的右键菜单中有一个Item: 删除 [删除当前选定的行]    <br />使用set value 来设定该UICompontent的dataProvider.[为了简单起见, 在测试时直接set一个ArrayCollection]</p>
<h3>二: 分析</h3>
<p>建议一个ItemEditor的类, 在该类中增加名为 get ui, 返回值为UICompontent, 属性为Public的函数, 在该类中新建DataGrid, 设置DataGrid的属性, 增加右键, return该DataGrid,完成任务</p>
<p>要点:</p>
<p>1:DataGrid设置ItemEditor为ComboBox    <br />2:Air中使用右键</p>
<h3>三: 代码实现[Set Value比较简单,故省略]</h3>
<pre class="java" name="code">/**
	 * 在外界呼叫get ui时,返回一个UICompontent,该UICompontent包含以下内容:
	 * 右键: Restore
	 * 返回一个UICompontent[此处为DataGrid]
	 */
	public function get ui():UIComponent {
		if(_dataGrid != null) {
			return _dataGrid;
		}

		//新建一个DataGrid
	 	_dataGrid = new DataGrid();
	 	_dataGrid.editable = true;	

		//增加右键
		var menu:NativeMenu = new NativeMenu();
		var menuItemDelete:NativeMenuItem = new NativeMenuItem(&quot;Delete&quot;);
	        //监听事件,在右键选定Delete时运行该函数
		menuItemDelete.addEventListener(Event.SELECT, onMenuDeleteClicked);
		//将该menuItem加入到Menu中
		menu.addItem(menuItemDelete);

		_dataGrid.contextMenu = menu; //将菜单加入到DataGrid中

	 	columnLocale = new DataGridColumn();  //新建一个列
	 	columnLocale.dataField = &quot;locale&quot;;
	 	//设定DataGrid中locale列的EditItem;
	 	comboBoxLocaleEditor = new ClassFactory(ComboBox); // DisabledComboBox);
	 	comboBoxLocaleEditor.properties = {dataProvider : LocalizationItem.localeArray} //设定该EditorItem的属性
	 	columnLocale.itemEditor = comboBoxLocaleEditor;

                _dataGrid.showHeaders = false; //隐藏DataGrid的Header
	 	_dataGrid.columns = [columnLocale]; //这一个数组,如果有多列则以逗号隔开都放进去
	 	_dataGrid.dataProvider = value;	//设定DataGrid的dataProvider value为实际使用时Set的

		return _dataGrid;
	}</pre>
<h3>四:抓图</h3>
<p><a href="http://liguoliang.com/wp-content/uploads/2008/10/image14.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="195" alt="image" src="http://liguoliang.com/wp-content/uploads/2008/10/image-thumb14.png" width="230" border="0" /></a> </p>
<p>[为了方便起见上面代码简略了一部分]</p>
<p><p>

----------Post from: <a href="http://liguoliang.com">@LiGuoliang.com, 欢迎回来~</a>----------</p></p>
]]></content:encoded>
			<wfw:commentRss>http://liguoliang.com/2008/actionscript%e4%b8%ad%e4%bd%bf%e7%94%a8%e8%87%aa%e5%ae%9a%e4%b9%89%e7%bb%84%e4%bb%b6-use-customui-in-flex-with-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

