<?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>ハセテツラボ &#187; AIR</title>
	<atom:link href="http://tt-house.com/category/air/feed" rel="self" type="application/rss+xml" />
	<link>http://tt-house.com</link>
	<description>生涯一開発屋</description>
	<lastBuildDate>Wed, 08 Sep 2010 23:42:04 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AIRでタスクバーのアイコンを点滅させる</title>
		<link>http://tt-house.com/2009/03/air_flashing_icon.html</link>
		<comments>http://tt-house.com/2009/03/air_flashing_icon.html#comments</comments>
		<pubDate>Mon, 23 Mar 2009 13:25:10 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://www.tt-house.com//wp/?p=92</guid>
		<description><![CDATA[this.nativeWindow.notifyUser(Notificati...]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Ftt-house.com%252F2009%252F03%252Fair_flashing_icon.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22AIR%E3%81%A7%E3%82%BF%E3%82%B9%E3%82%AF%E3%83%90%E3%83%BC%E3%81%AE%E3%82%A2%E3%82%A4%E3%82%B3%E3%83%B3%E3%82%92%E7%82%B9%E6%BB%85%E3%81%95%E3%81%9B%E3%82%8B%22%20%7D);"></div>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>this.nativeWindow.notifyUser(NotificationType.CRITICAL);</p>
</blockquote>
<p dir="ltr">AIR1.5です。サンプルがAdobeのサイトにもあったんですけど、AIR1.0っぽくてFLEX Builderに怒られました。上記の例だと、アプリケーションにフォーカスがあたるまで点滅し続けます。すでにアクティブの場合、なんにも起こりません。</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p dir="ltr">this.nativeWindow.notifyUser(NotificationType.INFORMATIONAL);</p>
</blockquote>
<p dir="ltr">こっちの例だと2～3回タスクアイコンが点滅します。アクティブであろうとなかろうと点滅します。ただ、点滅し続けてはくれないのでアラートとしては物足りないかも。</p>
<p dir="ltr">あ、Windowsでのサンプルです。MacだとNGです。クロスプラットフォームを謳い文句にしているのに、ちと微妙な気分です。</p>

]]></content:encoded>
			<wfw:commentRss>http://tt-house.com/2009/03/air_flashing_icon.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIRでアプリケーション終了の確認ダイアログを表示する</title>
		<link>http://tt-house.com/2009/02/confirm_close_on_air.html</link>
		<comments>http://tt-house.com/2009/02/confirm_close_on_air.html#comments</comments>
		<pubDate>Fri, 13 Feb 2009 11:30:36 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://www.tt-house.com//wp/?p=85</guid>
		<description><![CDATA[不慣れなActionScript、はじめてのAIR開発とあって、いろんなことでつ...]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Ftt-house.com%252F2009%252F02%252Fconfirm_close_on_air.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22AIR%E3%81%A7%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E7%B5%82%E4%BA%86%E3%81%AE%E7%A2%BA%E8%AA%8D%E3%83%80%E3%82%A4%E3%82%A2%E3%83%AD%E3%82%B0%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B%22%20%7D);"></div>
<p>不慣れなActionScript、はじめてのAIR開発とあって、いろんなことでつまづき続けています。</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;mx:WindowedApplication xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; applicationComplete=&#8221;init()&#8221; layout=&#8221;absolute&#8221;&gt;<br />&lt;mx:Script&gt;<br />&nbsp;&lt;![CDATA[<br />&nbsp;&nbsp;import mx.controls.Alert;<br />&nbsp;&nbsp;import mx.events.CloseEvent;<br />&nbsp;&nbsp;private function init():void<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;　　addEventListener(Event.CLOSING,application_closing);<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;private function application_closing(event:Event):void<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;　　event.preventDefault();<br />&nbsp;&nbsp;&nbsp;　　Alert.show("終了しますか？","終了の確認",Alert.YES | Alert.CANCEL,null,goto_close);<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;private function goto_close(event:CloseEvent):void<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;　　if(event.detail==Alert.YES)<br />&nbsp;&nbsp;&nbsp;　　{<br />&nbsp;&nbsp;&nbsp;&nbsp;　　nativeWindow.close();<br />&nbsp;&nbsp;&nbsp;　　}<br />&nbsp;&nbsp;}<br />&nbsp;]]&gt;<br />&lt;/mx:Script&gt;<br />&lt;/mx:WindowedApplication&gt;</p>
<p>&nbsp;</p>
</blockquote>
<p dir="ltr">applicationCompleteでイベントリスナーを追加しています。「closingイベントが起こったら呼べや」っていう感じですね。</p>
<p dir="ltr">で、呼ばれた関数の中で、ひとまずclosingイベントをキャンセルしています。確認云々のまえにキャンセルです。問答無用です。そのあと、確認します。キャンセルしておいて確認です。</p>
<p dir="ltr">確認ダイアログは、結果もコールバック関数です。これもはじめは違和感バリバリでした。C#だとそこで1回処理がとまるじゃないですか。基本的にすべてコールバック関数。慣れるまで戸惑いそうです。</p>
<p dir="ltr">確認ダイアログの結果によって、プログラムからアプリケーションを終了します。</p>
<p dir="ltr">正直、これが正しい実装方法なのかはまったくわかりません。こんな泥臭い方法じゃなくて、もっとスマートな記述方法があるのかもしれません。</p>
<p dir="ltr">まぁ、やりたかったことはできているようなのでOKかなと。</p>
<p dir="ltr">AIR 1.5、ActionScript 3.0です。</p>

]]></content:encoded>
			<wfw:commentRss>http://tt-house.com/2009/02/confirm_close_on_air.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
