▼ActionScript 3.0メモ▼
ADFの書式
「ADF」とは、AIRアプリケーションの属性を記述するXMLファイル。
次のように記述する。
属性間での改行は可能だが、タグに囲まれた部分(<hoge>〜</hoge>)での改行はNGとなる。
HelloWorld-app.xml <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0"> <id>net.npaka.HelloWorld</id> <version>1.0</version> <filename>HelloWorld</filename> <description>This is HelloWorld.</description> <copyright>(C) NPAKA 2007</copyright> <initialWindow> <title>HelloWorld</title> <content>HelloWorld.swf</content> <systemChrome>standard</systemChrome> <transparent>false</transparent> <visible>true</visible> </initialWindow> </application>
先頭1行目はXML宣言で決まり文句。
「applicationタグ」内の属性は次の1つ。
タグ 必須/オプション 説明 例 xmlns 必須 デフォルトの名前空間として必ず以下のURIを指定
http://ns.adobe.com/air/application/1.0<application xmlns="http://ns.adobe.com/air/application/1.0">
「applicationタグ」内に配置するタグは次の13個。
タグ 必須/オプション 説明 例 id 必須 アプリケーションを識別するためのユニークなID
他の人のアプリとかぶらないように自分のホストを頭に付加すると良い
使用可能な文字は「0-9」「a-z」「A-z」「.」「-」<id>net.npaka.HelloWorld</id> version 必須 バージョン <name>1.0</name> filename 必須 ファイル名 <filename>HelloWorld</filename> name オプション タイトル名。インストール時に表示 <name>HelloWorld</name> description オプション 説明。インストール時に表示 <description>This is HelloWorld.</description> copyright オプション コピーライト。インストール時に表示 <copyright>(C) NPAKA 2007</copyright> initialWindow 必須 初期ウィンドウ。次表で解説 <initialWindow>
<title>HelloWorld</title>
<content>HelloWorld.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
</initialWindow>installFolder オプション インストール先フォルダ名 <installFolder></installFolder> programMenuFolder オプション スタートメニューの配置(Windowsのみ) <programMenuFolder>Example Company/Example Application</programMenuFolder> icon オプション アイコンを指定 <icon>
<image16x16>16.png</image16x16>
<image32x32>32.png</image32x32>
<image48x48>48.png</image48x48>
<image128x128>128.png</image128x128>
</icon>customUpdateUI オプション アプリケーションのバージョンアップの許可フラグ <customUpdateUI></customUpdateUI> allowBrowserInvocation オプション Webブラウザでクリックした時のアプリケーション起動の許可フラグ <allowBrowserInvocation></allowBrowserInvocation> fileTypes オプション ファイル拡張子登録
fileTpe(ファイル拡張子種別)
name(名前)
extension(拡張子)
description(説明)
contentType(コンテントタイプ)
icon(アイコン)<fileTypes>
fileType>
<name>com.example</name>
<extension>xmpl</extension>
<description>Example file</description>
<contentType>example/x-data-type</contentType>
<icon>
<image16x16></image16x16>
<image32x32></image32x32>
<image48x48></image48x48>
<image128x128></image128x128>
</icon>
</fileType>
</fileTypes>
「initialWindowタグ」内に配置するタグは次の14個。
タグ 必須/オプション 説明 例 content 必須 最初にロードされるSWF/HTML <content>HelloWorld.swf</content> title オプション タイトルバーの文字列 <title>HelloWorld</title> systemChrome オプション standard:ウィンドウ枠を表示する
none:ウィンドウ枠を表示しない<systemChrome>standard</systemChrome> transparent オプション ウィンドウを透明にするかどうか
trueを指定できるのはsystemChrome="none"の時のみ<transparent>false</transparent> visible オプション アプリケーションの表示・非表示 <visible>true</visible> minimizable オプション 最小化の有無(true/false) <minimizable>true</minimizable> maximizable オプション 最大化の有無(true/false) <maximizable>true</maximizable> resizable オプション リサイズの有無(true/false) <resizable>true</resizable> width オプション ウィンドウ幅 <width>500</width> height オプション ウィンドウ高さ <height>500</height> x オプション ウィンドウX座標 <x>150</x> y オプション ウィンドウY座標 <y>150</y> minSize オプション 最小ウィンドウサイズ <minSize>300 300</minSize> maxSize オプション 最大ウィンドウサイズ <maxSize>800 800</maxSize>
−戻る−