慣れるために、HTMLを使用した「Hello World!」の例を作成します。
必要なプログラムのインストール
まず、 Adobe AIRパッケージ自体をダウンロードする必要があります(WindowsとMaxOSXのバージョンがあり、Linuxバージョンを作成すると約束されています)。
次に、アプリケーション開発用のSDK
あなたにとって便利な場所を設定し、パスを覚えておいてください-それはあなたにとって便利になります。
プロジェクトファイルを作成する
各HTML AIRプロジェクトには、プロジェクト記述ファイルとHTMLのメインアプリケーションページの少なくとも2つのファイルが含まれています。 この例では、JavaScriptを介して挿入するためにフォーマットされたテキストを含む別のHTMLファイルも使用しています。 AIR APIクラスでエイリアスを作成するためのAIRAliases.jsファイルもあります。
開始するには、HelloWorldフォルダーを作成します。 AIRAliases.jsファイルをSDKフォルダーからHelloWorldフォルダーにコピーします。
大規模で複雑なアプリケーションの場合、スクリプト、画像、およびスタイル用により複雑なフォルダー構造が必要になる場合がありますが、この場合は1つのフォルダーで十分です。
プロジェクト記述ファイルの作成
最も単純なファイルは次のようになります。
<アプリケーション> <id> ... </ id> <バージョン> ... </バージョン> <ファイル名> ... </ファイル名> <initialWindow> <content> ... </ content> <visible> ... </ visible> <幅> ... </幅> <高さ> ... </高さ> </ initialWindow> </ application>
- 空のファイルを作成し、HelloWorld-app.xmlという名前を付けてプロジェクトディレクトリに保存します
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
を持つ要素AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
追加しAIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html,. :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
AIR
. "1.0.6" runtime, .
examples.html.HelloWorld
. . , .
0.1
-
HelloWorld
- ,
:
HelloWorld.html
- HTML , .true
- . .400
- .200
- .
. :
<?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://ns.adobe.com/air/application/1.0.M6"> <id>examples.html.HelloWorld</id> <version>0.1</version> <filename>HelloWorld</filename> <initialWindow> <content>HelloWorld.html</content> <visible>true</visible> <width>400</width> <height>200</height> </initialWindow> </application>
.
HTML .
1) HelloWorld.html, . :
<html> <head> <title>Hello World</title> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>Loaded text:</p> <div id="display"> </div> </body> </html>
2)AIRAliases.js
API . :
var textFile = new runtime.flash.filesystem.File("app:/textfile.txt");
.
AIRAliases.js . , :
var textFile = new air.File("app:/textfile.txt");
3) AIRAliases.jsappLoad
:
<script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace(" : " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script>
air.trace("");
ADL, .
:
File
var textFile = new air.File("app:/textfile.txt");
FileStream
textStream.open(textFile, air.FileMode.READ);
var fileText = textStream.readUTFBytes(textStream.bytesAvailable);
.
:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>Hello World</title> <script type="text/javascript" src="AIRAliases.js"></script> <script type="text/javascript"> function appLoad(){ air.trace("Hello World"); // var textFile = new air.File("app:/textfile.txt"); if(textFile.exists){ var textStream = new air.FileStream(); textStream.open(textFile, air.FileMode.READ); if(textStream.bytesAvailable > 0){ var fileText = textStream.readUTFBytes(textStream.bytesAvailable); textStream.close(); air.trace("Text read: " + fileText); // 'p' var displayDiv = document.getElementById('display'); var paragraph = document.createElement('p'); var textNode = document.createTextNode(fileText); paragraph.appendChild(textNode); displayDiv.appendChild(paragraph); } else { air.trace(" ."); } } else { air.trace(" ."); } } </script> </head> <body onLoad="appLoad();"> <h1>Hello World</h1> <p>:</p> <div id="display"></div> </body> </html>
textfile.txt. .
ADL (AIR Debug Launcher). bin SDK.
. . :
adl HelloWorld-app.xml
adl , " SDK"/bin .
:
.
. , . VerySign Thawte. , "" .
1) :
adt -certificate -cn SelfSigned 1024-RSA sampleCert.pfx samplePassword
2) :
adt -package -storetype pkcs12 -keystore sampleCert.pfx HelloWorld.air HelloWorld-app.xml HelloWorld.html AIRAliases.js textfile.txt
(samplePassword)
HelloWorld.air .
, . . , . AIR Runtime!
PS . ! , ?
-