Starting with the most useful help page:
http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac25d3d8c712b2d86751e-8000.html
All the instructions here are good, save one line in HelloWorld.xml. Replace:
<application xmlns="http://ns.adobe.com/air/application/2.7">
With:
<application xmlns="http://ns.adobe.com/air/application/18.0">
Presumably this should match the version of AirSDK that you have installed on your machine.
Create flexcfg.xml:
mxmlc -dump-config flexcfg.xml
This will throw compiler errors, ignore them. There will be many problems with this file, which need to be fixed. Several paths will not be set correctly:
<path-element>libs</path-element>
(and others, all starting with < path-element >)
These will reference files from your AirSDK, but it will not reference them correctly.
I put the full path to my local AirSDK:
<path-element>C:/dev/AirSdk/frameworks/libs</path-element>
This path will be unique to your installation of the AirSDK. Once again, there will be several of these, fix all of them, scattered in the file.
This gets a basic hello-world working. Now, for the file-access part, this link provides part of the solution:
Flash Builder: 1172 Definition Could not be found
Specifically, once again in your flexcfg.xml file, you need to find this line:
<external-library-path>
And add another line below it:
<path-element>C:/dev/AirSdk/frameworks/libs/air/airglobal.swc</path-element>
(once again, your AirSdk may be installed in another directory)
There are several places that will give you the necessary lines to write "Hello World" to a file, here's one:
Saving string to text file in AS3
Make sure you use "writeUTFBytes" as the answer indicates, rather than the question.
The final version of HelloWorld.as looks like this:
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.filesystem.*;
public class HelloWorld extends Sprite
{
public function HelloWorld()
{
var textField:TextField = new TextField();
stage.addChild( textField );
textField.text = "Hello, World!";
var outputFile:File = new File("C:/depot/sdks/ActionScriptSDK/HelloWorld/output.txt");
var stream:FileStream = new FileStream();
stream.open(outputFile, FileMode.WRITE);
stream.writeUTFBytes("Hello, File World!");
stream.close();
}
}
}
flexcfg.xml is MOSTLY generated automatically. It's a long file, I won't share it all, but I will share some relevant lines:
<external-library-path>
<path-element>C:/dev/AirSdk/frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc</path-element>
<path-element>C:/dev/AirSdk/frameworks/libs/air/airglobal.swc</path-element>
</external-library-path>
and later in the file:
<library-path>
<path-element>C:/dev/AirSdk/frameworks/libs</path-element>
<path-element>C:/dev/AirSdk/frameworks/locale/{locale}</path-element>
</library-path>
HelloWorld.xml is almost copy paste of the one from help.adobe.com, but here it is:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/18.0">
<id>samples.android.HelloWorld</id>
<versionNumber>0.0.1</versionNumber>
<filename>HelloWorld</filename>
<initialWindow>
<content>HelloWorld.swf</content>
</initialWindow>
<supportedProfiles>mobileDevice</supportedProfiles>
</application>
Finally, to wrap it up into one step, go.bat:
call mxmlc HelloWorld.as -load-config flexcfg.xml
call adl HelloWorld.xml