Step by Step: Flex Builder and AsWing Quick Start

Alva Sun April 26th, 2007

This tutorial actually shows you how to install the Flex Builder and the AsWing. What you will learn in doing this procedure will carry over into your new projects using other new library components(such as as3corelib).It’s also explain how to install and use subclipse( SVN pulg-in for Eclipse ) to checkout fresh code.

Catalog

Basic Part:
1 Download and install Flex Builder(the standalone version)

1.1 Download Flex Builder2.0
1.2 Stratup Flex Builder

2 Download and install AsWing

2.1 Downlaod AsWingA3
2.2 Import AsWing project
2.3 Clean to Build

3 Create,Compile,Run a Application that use AsWing components.

3.1 Create a new ActionScript Project
3.2 Run the application

Advanced Part:
4 Install Flex Builder as a plugin of Eclipse.

4.1 Download and install JDK1.5
4.2 Download and install Eclpse3.2
4.3 Install Flex Builder pulgin

5 Checkout AsWing from SVN

5.1 Install SVN plugin for Eclipse
5.2 Checkout fresh source code


1 Download and install Flex Builder(the standalone version)

1.1 Download Flex Builder2.0

In Basic Part, we selecte download “Flex Builder 2 (English|Windows|168.78 MB)”;
download flex builder

Double click the file you hava downloaded which name like “FLXB_2.0_Win_WWE.exe
select “Flex Builder and Flex SDK”
select flex builder and flex sdkSelect a folder to install Flex Builder.I change to “G:\Flex\Flex Builder 2”.
Select a folder to install Flex Builder

Installing…
Installing

Flex Builder is installed Complete.
installed Complete

1.2 Stratup Flex Builder.

After Download and Install Flex Builder, we can select Start -> All Programs -> Adobe -> Adobe Flex Builder 2 to open Flex Builder.
The Flex Builder is starting, it’s version is 2.0.1.
Flex Builder is starting

The main window of Flex Builder.
The main window of Flex Builder


2 Download and install AsWing

2.1 Downlaod AsWingA3

At the beginning,we download packaged version of AsWing at Here.
Selecte “AsWing A3 0.8”(it will change when you visit this page). Remember to choose AsWing A3 series which is base ActionScript 3.The downloaded file name is “aswing_a3_0_8.zip”.
Downlaod AsWingA3

Change default Workspace to “G:\acode”, Flex Builder will restart automatic.
Change default Workspace

Choose a folder as workspace of Flex Builder.
Choose a folder as workspace

Create a “Flex Library Project” with name ”AsWingA3”.
Create a “Flex Library Project”

2.2 Import AsWing project.

Unpack the “aswing_a3_0_8.zip” to somewhere. Right-Click on project “AsWingA3″ select “Import”
select “Import”

Select import form “File System”
Select import form “File System”

Select the location you unpacked,
Select the location you unpacked

Select into folder, it’s “AsWingA3″.
Select into folder

Some Properities setup
Right click on the AsWingA3 project, select “Properities” at the bottom.
select “Properities” at the bottom

Change to “Flex Build Path”, check the “src” folder and ,fill “src” in “Main sorce folder”
Change to “Flex Build Path”,

Select “Flex Library Complier” , Uncheck the “Enable warnings”,
Select “Flex Library Complier”

2.3 Clean to Build

Select “Project” -> “Clean…”
Select “Project” -> “Clean…”

Check the projects yout want to clean and rebuild.Press “OK” button.
clean and rebuild.

Building project will take you about one minute.
Building project

After build project, a new library file(AsWingA3.swc) is created.
a new library file(AsWingA3.swc) is created


3 Create,Compile,Run a Application that use AsWing components.

3.1 Create a new ActionScript Project with project name “AsWingExamples”.

Create a new ActionScript Project

Fill AsWingExamples in “Project name” ,click Finish button.
Fill AsWingExamples in “Project name”

Create a Source Code Forlder with name “src”,
Create a Source Code Forlder with name “src”,
fill src

Open Properities pane, select “ActionScript Build Path”->”Source path”,fill “src” in “Main sorce folder”
select “ActionScript Build Path
select “ActionScript Build Path”2

Change to “Library path”,click “Add Project” button,
Change to “Library path”,

select “AsWingA3” as a library.
select “AsWingA3” as a library.

Create a ActionScript Class with name “Test”, copy the code into it:
Create a ActionScript Class
new class

Source code of Test.as


package
{
 import flash.display.Sprite;
 import flash.display.StageScaleMode;

import org.aswing.AsWingManager;
 import org.aswing.JFrame;
 import org.aswing.JLabel;
 import org.aswing.event.AWEvent;
 import org.aswing.geom.IntDimension;public class Test extends Sprite
 {
  public function Test(){
  super();
  stage.scaleMode = StageScaleMode.NO_SCALE;
  stage.stageFocusRect = false;
  AsWingManager.setRoot( this );createFrame();
  }
private function createFrame() : JFrame{
  var frame : JFrame = new JFrame( this, "Test of AsWingA3" );
  frame.getContentPane().append(new JLabel( "Hello world!" ));
  frame.setSize(new IntDimension( 200, 120 ) );
  frame.show();
  return frame;
  }
 }
}


Source code of Test.asSelect “ActionScript Applications”,click “Remove” button to delete “AsWingExamples.as(deleted)”,
Removethen press “Add” button, select “Test.as”,
Addpress “Set as Default” to set “Test.as” as the default Main Class.
the default Main ClassYou’ll find the icon of “Test.as” is changed to which mean Main Class.
find the icon

3.2 Run the application

At the end, press the green “Run” button at ToolBar, select “Test”,
Run

wait a second, a html page is popup with our first ActionScript application.
a html page is popup


4 Install Flex Builder as a plugin of Eclipse.

4.1 Download and install JDK1.5

Download JDK 5.0 Update 11 here:
Download JDK 5.0

Choose “Accept License Agreement”
Choose “Accept License Agreement”

Download “Windows Offline Installation Muti-language”
Download “Windows Offline Installation Muti-language”

Install JDK is simple,
jdk will install at “C:\Program Files\Java\jdk1.5.0_11\”,
jre wiil install at “C:\Program Files\Java\jre1.5.0_11\”,
you can change the install folder.

4.2 Download and install Eclpse3.2

Dlownload Eclipse 3.2 here:
Dlownload Eclipse 3.2

unpack the file “eclipse-SDK-3.2-win32.zip” to a location you choose. I choose “G:\eclipse”
unpack the file “eclipse-SDK-3.2-win32.zip”

Double click “eclpse.exe” to open it.It will popup a “Workspace Launcher”. I change it to “G:\workspace”, and check “User this as the default and do not ask again”.
Double click “eclpse.exe”

4.3 Install Flex Builder pulgin

Download “Flex Builder 2 Eclipse Plug-in” see 1.1.
Double click the file you hava downloaded which name like “FLXB_2.0_Win_WWE.exe”
select “Flex Builder Plug-in and Flex SDK”
select “Flex Builder Plug-in and Flex SDK”

Choose install forlder for the Flex Framework,
Choose install forlder for the Flex Framework,

Choose Eclipse Folder to be Updated, fill the path of Eclips(My eclipse path is “G:\eclipse”).
Choose Eclipse Folder to be Updated

Installing…
Installing…


5 Checkout AsWing from SVN

5.1 Install SVN plugin(subclipse) for Eclipse

Open Help -> Software Updates -> Find and Install,
Find and Install,

We need to select the radio button”Search for new Features to install” to indicate that this is a new install.
Search for new Features to install

We press “New Remote Sit…” button,fill Name with “SVN” and URL with” http://subclipse.tigris.org/update_1.2.x
New Remote Sit

There are two sub-item of site “SVN”. Uncheck the “Mylar Integration”,only check “Subclipse”.
two sub-item

Click the button to accept the license agreement.
accept the license agreement

Press Finish to start installing…
Press Finish to start installing…

Select “Install All”
Select “Install All”

The screenshot of the in-process installation.
The screenshot of the in-process installation.

Eclipse needs to be restarted after installing Subclipse.
Eclipse needs to be restarted after installing Subclipse.

5.2 Checkout fresh source code
open svn perspective
select SVN Repository Exploring

Right-click on the blank of “SVN Repository” , select “New” -> “Repository Location…”
new location

Fill AsWingA3’s SVN url: http://svn.aswing.org/aswing/
fill aswing’s url

Expand the list, select “trunk”, right-click on “AsWing”,choose “Checkout”.
choose Trunk

Select the radio button “Check out as a project configured using the New Project Wizard”.
check out as a project

Popup a “New Project” window, select “Flex” -> “Flex Library Project”.
select flex library project

Type the project name : “AsWingA3”.
type project name

The process of checkout aswing code from SVN server.
checkouting

Open the “Properities for AsWingA3” window,change to “Flex Library Build Path”, only check “src”. Type “src” in “Main Source Folder”.
set properites

Change to “Flex Library Complier”, uncheck “Enable warning”.
uncheck enable warning

At the end, select “Project” -> “Clean”, to rebuild the fresh code.
ok le

You can contact me by mail: AlvaSun#gmail.com

13 Responses to “Step by Step: Flex Builder and AsWing Quick Start”

  1. iileyon 26 Apr 2007 at 10:33 pm

    Great, this is a great detailed tutorial for beginners!!

  2. memoryon 26 Apr 2007 at 11:10 pm

    that’s so so good,think more guys will join in aswing project by this simple detailed guide.

  3. hbfon 02 May 2007 at 3:54 am

    Wow, really nice. Helped me a lot! Many, many thanks.

  4. infridon 29 Jul 2007 at 5:11 am

    man, you absolutely rock.

    How very patient and kind of you to make this.. When I saw the scroll bar I assumed this page was lots of comments. This is my first tase of aswing, and it reminds me of my first taste of rails (as in detailed, helpful and clearly demonstrates passion for the framework), well done, and thanks!

  5. Shared Hosting Resourceson 30 Aug 2007 at 2:12 am

    Shared Hosting Resources…

    I couldn’t understand some parts of this article, but it sounds interesting…

  6. World Wide Web Resourceson 14 Sep 2007 at 9:58 pm

    World Wide Web Resources…

    I couldn’t understand some parts of this article, but it sounds interesting…

  7. you CN?on 15 Nov 2007 at 1:20 am

    VERY GOOD ? NO !!!

    EDITION ZH_CN ?

    SIGH …. SIGH FOR YOU …….

  8. yuquanjieon 09 Jan 2008 at 6:39 am

    when i compile the aswing3_1.2,use flex2 ,error
    1119 access of possibly undefined property REMOVED_FROM_STAGE through a reference with static type Class.
    1119 Access of possibly undefined property ADDED_TO_STAGE through a reference with static type Class.

  9. yuquanjieon 09 Jan 2008 at 7:35 am

    who can explain it????

  10. sumiton 17 Mar 2008 at 12:54 am

    Nice work buddy.

  11. [...] tutorial mozna znaleźć tutaj Step By Step AsWing with FlexBuilder, oraz forum dyskusyjne AsWing [...]

  12. draiveon 09 Jul 2008 at 5:05 pm

    very very good

  13. lg_08on 21 Dec 2008 at 5:01 am

    this`s very very good

Trackback URI | Comments RSS

Leave a Reply

Bad Behavior has blocked 1194 access attempts in the last 7 days.