Book Image

Flex 3 with Java

Book Image

Flex 3 with Java

Overview of this book

Flex 3 is a great technology for developing Rich Internet Applications for the Web as well as for the desktop. If you are a developer looking to design great-looking and sophisticated user interfaces that resemble desktop-based applications, and want to utilize an existing server technology such as Java to develop RIAs, this book is for you. Targeting developers who want to get started with Adobe Flex 3 programming, this simple and clear handbook introduces Flex technology quickly and straightforwardly. Utilizing your existing knowledge of Java, it gives you the insight and hands-on experience to program with Flex 3. This book provides comprehensive information on various aspects of Flex 3 and ActionScript 3.0. These include developing simple applications, handling events, creating custom components and events, using RPC services, integration with Java and BlazeDS, styling and formatting, and how to package and deploy Flex applications. You will start with downloading, installing and configuring Flex 3 SDK and Flex Builder 3 and learn basic concepts such as what MXML and ActionScript are, understanding UI components, controls, compilers, and more. Further you will develop simple applications and slowly advance into more depth where you will learn advanced concepts such as creating custom components, debugging, integrating with Java, using RPC services, styling, internationalizing, and deploying Flex applications, and more. One of the things you're really going to love about this book is that you will develop a full-blown e-commerce application using a combination of Flex 3, ActionScript 3.0, BlazeDS 3.2, and Java. At the end of the book you will have the knowledge and experience needed to develop Rich Internet Applications.
Table of Contents (18 chapters)
Flex 3 with Java
Credits
About the Author
About the Reviewers
Preface
8
Communicating with Server-side Java

Installing Flex Builder 3


Flex Builder is the official IDE for creating Flex applications, and as I mentioned earlier, it is built on the Eclipse platform. Flex Builder provides very powerful coding tools, such as MXML, ActionScript, and CSS editors with syntax coloring and hinting, statement completion, code collapse, interactive step-through debugging, code profiling; and very importantly, a rich visual-designing user interface layout, and more.

Later in this book, I will be using this Flex Builder IDE for demonstrating Flex code examples.

Also, make a note that if you are installing Flex Builder 3, then you need not install Flex SDK separately because Flex Builder 3 installs Flex SDK automatically as a part of its installation. You will learn more about the directory structure that the installer creates when you install Flex Builder in Flex Builder installation directory structure section.

Unlike the open source Flex SDK, Flex Builder is a licensed product from Adobe which you need to buy. But you can download a 60-day evaluation copy from Adobe's web site at http://www.adobe.com/go/flex_trial. Flex Builder 3 is available on Windows, Mac OS, and Linux operating systems.

Flex Builder comes with two different installation options. They are:

  • Flex Builder as a standalone IDE: This option installs Flex Builder as a standalone IDE with only the Flex perspective. So if you need to work on a Java project, go for Flex Builder plugin installation on top of Eclipse or install JDT (Java Development Tools) in Flex Builder to support Java development. You can download JDT from http://www.eclipse.org/jdt/.

  • Flex Builder as an Eclipse plugin: This option installs Flex Builder as an Eclipse plugin on an existing Eclipse IDE. Before installing it, you must first install Eclipse 3.2, or higher. So make sure you have done that.

Note

An Eclipse perspective is a collection of windows/views and a mechanism of providing task-oriented interactions in the IDE that are associated with a particular programming language.

Flex Builder 3 installation consists of the following main components:

  • Flex SDK

  • The Eclipse-based IDE (Integrated Development Environment)

  • Flash Player 9 or higher versions

Now, assuming that you have downloaded Flex Builder 3 and are ready for installation, follow these steps. Please note that depending on which operating system you use, these steps will change. So please refer to the Adobe installation documentation at http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_fb.html#installation for installing it on Mac OS or Linux. There is only a one-step difference between installing Flex Builder as an Eclipse plugin and a standalone. I have combined installation steps for both into the following tutorial.

Start the installation by double-clicking on the downloaded file. A program, InstallAnywhere, should start. It may take a few minutes before the first screen appears. It is a good idea to close any running Windows applications (especially browser applications) because Flex Builder will install Flash Player 9 or higher.

The first screen will prompt you to choose a language. Choose the appropriate language from the drop-down list and click on the OK button to proceed.

The introduction screen will be displayed. Click on Next.

The next screenshot is the license agreement screen. Read the agreement, select the I accept the terms of the License Agreement option, and click on the Next button, as shown in the following screenshot:

Now you need to choose the installation folder. Click the Choose button to choose anything other than the default location. Now click on Next to proceed, as shown in the following screenshot:

The next screen will appear only if you are installing Flex Builder as an Eclipse plugin. In this step, you need to choose the existing Eclipse installation root folder so that the installation wizard can configure the Flex Builder plugin. This works only with Eclipse 3.2 or higher versions. Please skip this step if you are installing Flex Builder as a standalone version.

The next screen is an optional installation, but it is a quite important step because it prompts you to install the debug version Flash Player in each of your installed browsers on your computer. Installing the debug version of Flash Player is very important in order to use Flex Builder's debugger to debug Flex applications. So, for now, we will continue with the default selection and allow the install wizard to install the debug version of Flash Player. We will skip other optional components in this tutorial, so click on Next to proceed.

The following screen details the pre-installation summary of your selections throughout this install wizard. Just confirm that the details are correct and click on the Install button to begin the installation process.

The next screen shown notifies the user of the installation's progress. The install wizard will install all necessary files on your system, including Java Runtime Environment. This may take a while, so please be patient.

Once the installation is finished, you can launch Flex Builder 3 from Windows | Program Files | Adobe | Flex Builder 3.

Note

Adobe has a unique program called Free Flex Builder Pro for Education, where students and faculties can get a free licensed copy of Flex Builder 3 Professional. In order to register for this program, please visit http://www.adobe.com/products/flex/faq/#section-4.

Before we start using Flex Builder 3, let's have a quick look at its directory structure. The installer creates the following directory structure:

Directory

Description

Flex Builder 3

The top-level directory for Flex Builder

/configuration

A standard Eclipse folder that contains the config.ini file and error logs

/features

A standard Eclipse folder that contains the plugins corresponding to the features of Flex Builder

/jre

Contains Java Runtime Environment installed with Flex Builder, used by default when you run the standalone version of Flex Builder

/Player

Contains the different versions of Flash Player—the standard version and the debugger version

/plugins

Contains the Eclipse plugins used by Flex Builder

/sdks

Contains the different Flex SDKs for a directory description