Async Flash Studio Tutorial - Hello World

In this tutorial, You will be shown how to build a simple desktop application with Async Flash Studio.

Prerequisite


This tutorial assumes that you have some basic knowledge of, or programming experience with, the following technologies.

  • Flex and actionscript 3

Software Needed for This Tutorial


Before you begin, you need install following software on your computer


Build a simple application by Flash Builder


Following is the source code of a simple Flex Application. Compile this application with Flash Builder, and you will get a flash movie file "helloworld.swf".


helloworld.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#4FE222">
	<mx:Label x="101" y="126" text="Hello World!" fontSize="36" fontWeight="bold" color="#EBED33" alpha="1"/>
</mx:Application>

Bring Helloworld.swf to Desktop


Run AFS Project wizard, set "Main Window Styles" as following screen shot shows.

Go to next page by click "Next" button at bottom of the dialog. There are still some advanced settings to fill. If you do not choose "No Embed", The flash control will be embed into the projector file.

Finally, Set Flash Projector Information
First, you must set the output file property of the projector, which defines the file path of the built execution file. The path can be absolute or relative file path. In this Tutorial, the output file is a relative path: helloworld.exe, which means that the output file will located at the same direcotry as the AFS project file. Another field you need to fill is the Icon file path of the projector. Set a relative path "assets/AFS.ico".

Click "Finish" Button, A new AFS project is created successfully. Save the project as helloworld.afs, and go to the directory of the AFS project, and

  1. Copy "helloworld.swf" to the directory.
  2. Make a sub directory named "assets" in the directory and copy an icon file, for instance "AFS.ico", to "assets" directory.
  3. In main view of AFS, add assets/AFS.ico to the embedding list.


Now all options have been set, you can generate projector now. Following is the screenshot of the projector.



The full source of the mxml application and AFS project file and assets mentioned in this tutorial can be found at the "Cookbook/Helloworld" directory in the installed directory of AFS.