This tutorial will help you get setup with FDT and ASWing.
1) Download the ASWing source files from the website from the download section.
2) Unzip the file to a directory of your choice.
3) Create a new Flash Project by click on the File - > New - > New Flash Project.
4) Type in the name of your project and click Next.
5) Click on the Create Source Folder… button, type in “src” for the folder name and click
on Finish.
6) Click on Finish to complete the initial setup. Next right click on the src folder and create a new class
7) Type in the class name and then click on Finish. In this example we will use Test.as.
8) Next we add the aswing source folder to our project. Right click on the ASWingTest
project and create a new linked library. Then click on the Add.. button and then click on the New.. button.
9) Type in aswing for the name of the library and browse to the src folder of ASWing for the
location. Then click on the OK button.
10) Click on OK again. You can see that the path variable has been added.
11) Click on Finish to complete adding the library to our project.
12) Add the following code to the Test.as file.
/** * @author firdosh */ import org.aswing. *; class Test extends JWindow { private var myButton : JButton; public function Test (Void) { super (_root, true); myButton = new JButton ("Test"); getContentPane ().append (myButton, BorderLayout.NORTH); } public static function main (Void) : Void { var myWindow : Test = new Test (); myWindow.setLocation (50, 50); myWindow.setSize (300, 300); myWindow.show (); } }
13) Next let us setup our run time environment. Click on Run → Run.. . Click on the
FDT - MTASC Support and click on the New button. Type in a name for the workspace.
14) In the Project section click on the Browse.. button , select the ASWingTest project and
click OK.
15) In the Main Class section click on the Browse.. button , type in Test and select the Test.as
from the list and click on OK
16) Click on the MTASC Arguments and we can specify other MTASC options in there.
17) Click on Run to compile the project. Below is the sample examples screenshot.
Discussion