Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flex Developer Center /

Exercise 1.1: Setting up your project files

by Trilemetry

Trilemetry
  • Trilemetry, Inc.

Content

  • Explore the default Flash Builder workspace
  • Using the provided exercise file as a Flash Builder project
  • Using the day project ZIP file as a Flash Builder workspace
  • Creating a new project

Modified

2 May 2011

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Flash Builder Flex RIA

Requirements

User level

Beginning

Required products

  • Flash Builder 4.5 Premium (Download trial)

Exercise files

  • ex1_01_solution.zip

The Flex in a Week training series consists of videos and exercises to teach experienced programmers how to program using the Flex 4.5 framework and Flash Builder 4.5. To gain the most from this series, watch the videos and complete the exercises in the order in which they are listed.

Each exercise includes associated exercise files, such as the ex1_01_solution.zip in the Exercise files section above. If you would rather download all the exercises for an entire day of the Flex in a Week series, you can find the respective project ZIP file on the Flex in a Week home page.

This exercise will step you through the process of importing the individual exercise files as Flash Builder 4.5 projects. You will also learn how to use the project ZIP file for individual days as a Flash Builder 4.5 workspace.

After you import the exercise project, you will compile and run a Flex application, shown in Figure 1, and see the generated SWF and HTML wrapper files in the bin-debug directory. You will learn how to create the application and populate it with data in the upcoming exercises.

Preview the tutorial application.
Figure 1. Preview the tutorial application.

In this exercise you will learn how to:

  • View the default workspace
  • Use a Flex in a Week exercise ZIP file as a Flash Builder project
  • Use the Flex in a Week day ZIP file as a Flash Builder workspace
  • Create a new Flash Builder project

Explore the default Flash Builder workspace

In this section you will view the default Flash Builder workspace.

Open Flash Builder.

If this is the first time you have opened Flash Builder, your environment should resemble the one shown in Figure 2. Note that the Flash Builder start page is open in the Editor view and various views surround it. These views can be opened and closed or moved within the user interface to create a custom development environment. More views may be opened by selecting them from the Window menu.

 View the default workspace.
Figure 2. View the default workspace.

You will use these Flash Builder views and many other features throughout this series.

Using the provided exercise file as a Flash Builder project

Each exercise ZIP file provided at the beginning of the exercises in this series includes an FXP file, which is a Flash Builder project archive. In this section you will import an FXP file into Flash Builder and compile the application to view it in a browser.

  1. Download the ex1_01_solution.zip file if you haven't done so already.
  2. Extract the archive file to any location on your computer.

    You should see that the archive contains the ex1_01_solution.fxp file.

  3. In Flash Builder, select File > Import Flex Project (FXP) (see Figure 3).
Select File > Import Flex Project (FXP).
Figure 3. Select File > Import Flex Project (FXP).
  1. Next to the File field, click the Browse button.
  2. Navigate to the ex1_01_solution.fxp file and click Open.
  3. Click Finish.
  4. In the Package Explorer, expand the src folder and the default package folder and double-click the ex1_01_solution.mxml file to open it.
  5. In the Editor view, review the MXML code for the application.

    Note the MXML comments that define sections for code placement. The headers are: Properties of the parent, Metadata, Styles, Script, Declarations, and UI Components. You will use these comments throughout the Flex in a Week training series to keep your code organized.

    Note also the Script block, which contains comments for import statements, variables, setters and getters, helper methods, and event handlers. The Script block is where you add your ActionScript business logic within an MXML file.

  6. Click the Run button to run the application (see Figure 4).
 Click the Run button to run the application.
Figure 4. Click the Run button to run the application.
  1. Note the browser URL path points to the file .../Adobe Flash Builder 4.5/ex1_01_solution/bin-debug/ex1_01_solution.html (see Figure 5).
 Note the URL of the Flex application.
Figure 5. Note the URL of the Flex application.

Note: The Adobe Flash Builder 4.5 directory you see here is not the program install directory. This is the default folder that Flash Builder creates in your user directory (on both Windows and Mac computers) to hold your project files.

  1. Return to Flash Builder.
  2. In the Package Explorer view, within the ex1_01_solution project, expand the bin-debug folder.
  3. Locate the ex1_01_solution.swf and ex1_01_solution.html files shown in Figure 6. The SWF file is the compiled Flex application and the HTML file is the wrapper file that you access in a browser.
 Expand the bin-debug folder to see the ex1_01_solution.html and ex1_01_solution.swf files.
Figure 6. Expand the bin-debug folder to see the ex1_01_solution.html and ex1_01_solution.swf files.

Using the day project ZIP file as a Flash Builder workspace

You learned earlier that the Flash Builder 4.5 directory created in the system's user directory is the default location where your project files are created. This location is more accurately called a workspace and you can create as many workspaces in Flash Builder as you would like to keep your projects logically organized.

In this section you will download the Flex in a Week Day 1 project ZIP file and access it as a new workspace in Flash Builder 4.5.

  1. In a browser, navigate to the Flex in a Week home page.
  2. Below the heading for Day 1, click the Day 1 project files link (see Figure 7) and save the file to your computer.

Note: You can download project files for each day of training. Each project zip is named FiaW_DayX_ProjectArchive.zip, with the appropriate number for that day of the course.

 Click the Day 1 project files link.
Figure 7. Click the Day 1 project files link.
  1. Extract the contents of the FiaW_Day1_ProjectArchive.zip file to any location on your computer.
  2. Explore the contents of the FiaW_Day1_ProjectArchive folder.

    Note: There are project folders as well as some video transcripts and a ReadMe text file in the project archive folders.

  3. In Flash Builder, select File > Switch Workspace > Other.
  4. Click the Browse button and navigate to the FiaW_Day1_ProjectArchive folder.
  5. Click the OK button (Windows) or Open button (Mac OS X).
  6. Click OK.

    Flash Builder will close and re-open. You should see all of the provided exercise files for Day 1 of this training series in the Package Explorer view (see Figure 8).

 View the Day 1 projects in the Package Explorer view.
Figure 8. View the Day 1 projects in the Package Explorer view.

Creating a new project

In this section you will learn how to create a new Flex project in Flash Builder.

  1. Select File > New > Flex Project (see Figure 9).
 Select File > New > Flex Project.
Figure 9. Select File > New > Flex Project.
  1. In the New Flex Project wizard, for the Project name, type EmployeeDirectory (see Figure 10).
 Type EmployeeDirectory for the Project name.
Figure 10. Type EmployeeDirectory for the Project name.
  1. On the Configure Server Settings page, note the Output folder is automatically set to the bin-debug folder (see Figure 11).
 Note the Output folder name.
Figure 11. Note the Output folder name.
  1. Click Next.

    Note that you can choose if your project contains an MX + Spark, Spark only, or MX only component set. Also note that the Main application file is automatically named the same as the project name. In this case, the file is EmployeeDirectory.mxml (see Figure 12).

The Main application file is named EmployeeDirectory.
Figure 12. The Main application file is named EmployeeDirectory.
  1. Keep the default settings and click Finish.

You should see the EmployeeDirectory project in the Package Explorer view and the EmployeeDirectory.mxml file open in the tabbed Editor view on the right (see Figure 13).

 Click Finish to see the EmployeeDirectory project in the Package Explorer view and the EmployeeDirectory.mxml file open in the tabbed Editor view on the right.
Figure 13. Click Finish to see the EmployeeDirectory project in the Package Explorer view and the EmployeeDirectory.mxml file open in the tabbed Editor view on the right.

IIn this exercise you learned how to import projects, compile an application, use a provided workspace and create a new project in Flash Builder 4.5. In the next excercise you will use Flash Builder to create the application user interface for a fictitious company's Employee Portal.

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This

  • Exercise 1.5: Experimenting with container layouts
  • Exercise 1.6: Creating MXML custom components with ActionScript properties
  • Exercise 5.2: Defining selector styles
  • Exercise 1.2: Creating an application user interface
  • Exercise 1.3: Generating an email address using data binding
  • Exercise 1.4: Adding data to your application
  • Exercise 4.7: Creating and navigating application states
  • Exercise 3.4: Passing data to the server with the HTTPService class
  • Exercise 3.4: Passing data to the server with the WebService class
  • Exercise 4.8: Creating a scalable user interface

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement