<?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>DigiTechLog Dot Com &#187; URI</title>
	<atom:link href="http://digitechlog.com/tag/uri/feed" rel="self" type="application/rss+xml" />
	<link>http://digitechlog.com</link>
	<description>Adobe AIR、Flex、Flash、Java</description>
	<lastBuildDate>Tue, 08 Nov 2011 12:46:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adobe AIRアプリケーションのインストールパスにファイルURIを取得するサンプルソースコード</title>
		<link>http://digitechlog.com/2008/12/17/how-to-get-file-uri-in-adobe-air-install-path-with-source-code.html</link>
		<comments>http://digitechlog.com/2008/12/17/how-to-get-file-uri-in-adobe-air-install-path-with-source-code.html#comments</comments>
		<pubDate>Wed, 17 Dec 2008 03:12:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[nativePath]]></category>
		<category><![CDATA[URI]]></category>

		<guid isPermaLink="false">http://digitechlog.com/2008/12/17/how-to-get-file-uri-in-adobe-air-install-path-with-source-code.html</guid>
		<description><![CDATA[この前に、Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード、CPreferencesManager: Adobe AIRのpreferencesマネージャークラスであるなどを勉強しました。今回はAIRの勉強を続きましょうー
Adobe AIRは、デスクトップ・アプリケーションを開発するので、ローカルファイルのアクセス操作は普通ですね。
一般的に、ファイルオブジェクトのURL属性をアクセスするとファイルのURIなど情報を取れますが、AIRアプリケーションには、そのような情報を取れません。

まず、下記のようなソースでURLを出力してみて：
var f:File = new File(&#34;app:/icon.png&#34;);
trace(f.url); //app:/icon.png
「app:/ URI」を正常で取れますが、AIR以外のアプリケーションには、URIを渡しても動かせないはずです。それで、どうやって取得しますか。下記のソースでやってみて：
var fPath:String = new File(new File(&#34;app:/icon.png&#34;).nativePath).url;
trace(fPath);
どう？
file:///digitechlog/tei/Documents/Flex%20Builder%203/AppName/bin-debug/icon.png
のようなパスが出力されてるでしょう。
Related Posts

トップ７個アドビAIRビデオアプリケーション
SWFフォーマット画像ファイルをローカルに保存とするAdobe AIRアプリケーション
リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版を公開した
Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード
Adobe AIRソーシャル・ネットワーキング(Social Network Service: SNS)アプリケーションリスト
Twitterなどマイクロブログイン(Microblogging)とコミュニケーションしやすいAdobe AIRアプリケーションリスト
Adobe AIRマルチメディアアプリケーションツールリスト（写真とビデオなど）
Adobe AIRが使ったGoogle関係製品のリスト

]]></description>
			<content:encoded><![CDATA[<p>この前に、<a href="http://digitechlog.com/2008/11/22/encrypt-your-sqlite-database-in-adobe-air-15.html">Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード</a>、<a href="http://digitechlog.com/2008/11/05/a-very-useful-adobe-air-preferences-class-cpreferencesmanager.html">CPreferencesManager: Adobe AIRのpreferencesマネージャークラスである</a>などを勉強しました。今回はAIRの勉強を続きましょうー</p>
<p>Adobe AIRは、デスクトップ・アプリケーションを開発するので、ローカルファイルのアクセス操作は普通ですね。</p>
<p>一般的に、ファイルオブジェクトのURL属性をアクセスするとファイルのURIなど情報を取れますが、AIRアプリケーションには、そのような情報を取れません。</p>
<p><span id="more-206"></span>
<p>まず、下記のようなソースでURLを出力してみて：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">var</span><span style="color: Gray;"> </span><span style="color: Blue;">f</span><span style="color: Gray;">:</span><span style="color: Blue;">File</span><span style="color: Gray;"> = </span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Blue;">File</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">app:/icon.png</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Teal;">trace</span><span style="color: Olive;">(</span><span style="color: Blue;">f</span><span style="color: Gray;">.</span><span style="color: Teal;">url</span><span style="color: Olive;">)</span><span style="color: Gray;">; </span><span style="color: #ffa500;">//app:/icon.png</span></li></ol></div>
<p>「app:/ URI」を正常で取れますが、AIR以外のアプリケーションには、URIを渡しても動かせないはずです。それで、どうやって取得しますか。下記のソースでやってみて：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Green;">var</span><span style="color: Gray;"> </span><span style="color: Blue;">fPath</span><span style="color: Gray;">:</span><span style="color: Teal;">String</span><span style="color: Gray;"> = </span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Blue;">File</span><span style="color: Olive;">(</span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Blue;">File</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">app:/icon.png</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Blue;">nativePath</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: Teal;">url</span><span style="color: Gray;">;</span></li>
<li><span style="color: Teal;">trace</span><span style="color: Olive;">(</span><span style="color: Blue;">fPath</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li></ol></div>
<p>どう？</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">file</span><span style="color: Gray;">:</span><span style="color: #ffa500;">///digitechlog/tei/Documents/Flex%20Builder%203/AppName/bin-debug/icon.png</span></li></ol></div>
<p>のようなパスが出力されてるでしょう。</p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://digitechlog.com/2009/07/25/top-7-adobe-air-apps-for-videos-you-should-know.html" title="トップ７個アドビAIRビデオアプリケーション">トップ７個アドビAIRビデオアプリケーション</a></li>
<li><a href="http://digitechlog.com/2009/01/16/the-tutorial-on-how-to-save-swf-file-from-an-image-bitmap-in-adobe-air.html" title="SWFフォーマット画像ファイルをローカルに保存とするAdobe AIRアプリケーション">SWFフォーマット画像ファイルをローカルに保存とするAdobe AIRアプリケーション</a></li>
<li><a href="http://digitechlog.com/2008/12/20/rich-internet-application-ria-runtime-adobe-air-15-linux-platform-is-relaeased.html" title="リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版を公開した">リッチインターネットアプリケーション (RIA) 実行環境「Adobe AIR 1.5」のLinux版を公開した</a></li>
<li><a href="http://digitechlog.com/2008/11/22/encrypt-your-sqlite-database-in-adobe-air-15.html" title="Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード">Adobe AIR 1.5でSQLiteデータベースを暗号化とするサンプルソースコード</a></li>
<li><a href="http://digitechlog.com/2008/11/04/the-list-of-adobe-air-social-network-application-tools.html" title="Adobe AIRソーシャル・ネットワーキング(Social Network Service: SNS)アプリケーションリスト">Adobe AIRソーシャル・ネットワーキング(Social Network Service: SNS)アプリケーションリスト</a></li>
<li><a href="http://digitechlog.com/2008/11/03/the-list-of-micrologging-like-twitter-adobe-air-application.html" title="Twitterなどマイクロブログイン(Microblogging)とコミュニケーションしやすいAdobe AIRアプリケーションリスト">Twitterなどマイクロブログイン(Microblogging)とコミュニケーションしやすいAdobe AIRアプリケーションリスト</a></li>
<li><a href="http://digitechlog.com/2008/10/29/the-list-of-photo-and-video-application-in-adobe-air.html" title="Adobe AIRマルチメディアアプリケーションツールリスト（写真とビデオなど）">Adobe AIRマルチメディアアプリケーションツールリスト（写真とビデオなど）</a></li>
<li><a href="http://digitechlog.com/2008/10/29/the-list-of-google-pruduct-in-adobe-air.html" title="Adobe AIRが使ったGoogle関係製品のリスト">Adobe AIRが使ったGoogle関係製品のリスト</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://digitechlog.com/2008/12/17/how-to-get-file-uri-in-adobe-air-install-path-with-source-code.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

