Adobe
产品
Acrobat
Creative Cloud
创意套装
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
更多产品
解决方案
数字营销
数字媒体
教育
金融服务业
政府部门
网页体验管理
更多解决方案
学习帮助下载公司
商店
在线商店
批量许可
查找经销商
搜索
 
信息 登录
欢迎,我的支持
我的帐户
注销
为何登录?登录后可以管理您的帐户,访问试用版下载、产品扩展和社区区域等。
Adobe
产品 分类 购买   搜索  
解決方案 公司
学习
登录 注销 我的货物 我的支持
Date Date
Qty:
Subtotal
Checkout
Adobe 开发者中心 / Flex 开发人员中心 /

Moving existing Flex projects from Flex Builder 3 to Flash Builder 4

by Andrew Shorten

Andrew Shorten

Modified

30 April 2010

页面工具

在 Facebook 上共享
在 Twitter 上共享
在 LinkedIn 上共享
书签
打印

Tags

要求

用户级别

全部

If you want to start using Flash Builder 4 with your existing Flex 3 projects, there are a number of different approaches you can take, depending on the Flex SDK features you want to use and the amount of migration work you're prepared to undertake.

Below is a quick guide to the options available to you, ordered by the amount of migration effort potentially required―from no effort (for using the existing Flex 3 SDK in Flash Builder 4) up to a full migration using all the new Flex 4 SDK language features and Spark components.

Note: To learn about the differences between Flex 3 SDK and Flex 4 SDK, you should read the article Differences between Flex 3 and Flex 4.

I want the new Flash Builder 4 features, but can't switch SDK versions.

Migration required: None; requires Flash Player 9 or higher

You can move existing Flex 3 applications, developed using Flex Builder 3, to Flash Builder 4 without needing to migrate the application to use the Flex 4 SDK―this enables you to get the benefit of most new Flash Builder 4 features straight away on an existing project.

Flash Builder 4 features include a network monitor, enhanced debugging, new refactoring support, code editing improvements, unit testing support, and the data-centric development (DCD) workflow―in total more than 50 features that will make you more productive when building Flex applications.

Watch James Ward demonstrate some of the new features in Flash Builder 4 that work with a project based on the Flex 3 SDK.

fig00 Watch the presentation (Running time: 5:02)

Follow the steps below to import projects into Flash Builder 4 and continue using Flex 3 SDK:

  1. In Flash Builder 4, go to File > Import > Flash Builder Project… (see Figure 1).
Import Flex Project
Figure 1. Import Flex Project
  1. After importing the project, you will see a dialog box asking you to choose the Flex SDK version of the project. Flash Builder 4 comes pre-installed with the latest version of the Flex 3 SDK, version 3.5.

    If your project is already based on Flex SDK 3.5 or you would like to move it to the latest release, then select Flex 3.5 from the "Use a specific SDK" pull-down menu (see Figure 2) and skip to Step 5.

Use a specific SDK
Figure 2. Use a specific SDK

If you were using Flex SDK 3.4 or earlier, then you will need to download the required SDK and configure Flash Builder 4 to use it―this is straightforward and only needs to be done once.

From the Adobe Open Source website, select a Milestone Release Build for Flex SDK 3.0, 3.1, 3.2, 3.3 or 3.4, depending on the SDK you are using with your project (you can check this in Flex Builder 3 by looking at the 'Flex Compiler' properties for the project). Alternatively select a stable or nightly build if you know that is what you need.

Unzip the downloaded SDK into the sdks folder in the Flash Builder 4 application folder ―on Mac OS X this will likely be /Applications/Adobe Flash Builder 4/sdks/ and on Windows /Program Files/Adobe/Adobe Flash Builder 4/sdks.

  1. Click the "Configure Flex SDKs…" link, the Choose Flex SDK Version dialog box, and then the "Add…" button. Select the SDK folder you just unzipped and Flash Builder should recognize it and add it to the list of installed Flex SDKs (see Figure 3).
Preferences (filtered)
Figure 3. Preferences (filtered)

Make sure to then select the newly installed SDK as the version in the "Use a specific SDK" pull-down menu.

  1. In the "Project will be upgraded" dialog box, select OK to make the project compatible with Flash Builder 4 (note that this will mean the project can no longer be opened in Flex Builder 3, but all your MXML and ActionScript files are still accessible via the file system should you want to merge any changes back into your project in Flex Builder 3) (see Figure 4).
Project Will Be Upgraded dialog box
Figure 4. Project Will Be Upgraded dialog box
  1. After completing the import process you may see an error reported in the Problems view that relates to the creation of the HTML Wrapper (see Figure 5). To resolve this issue, simply right click on the message and select "Recreate HTML Templates".
Error reported in the Problems view
Figure 5. Error reported in the Problems view

You are now ready to continue working on your Flex 3 project in Flash Builder 4!

I want the new Flash Builder 4 features and the faster Flex 4 compiler, but I need to maintain my application's existing behavior.

Migration required: Code changes unlikely; requires Flash Player 10

To use the faster Flex 4 compiler with an existing Flex 3 project, you can import it into Flash Builder 4 and use the "Flex 3 compatibility mode" option (see Figure 6)―this maintains the existing behavior of the application and shouldn't require any changes to your code. You should however see significantly improved compile times for the project.

Use Flex 3 compatibility mode
Figure 6. Use Flex 3 compatibility mode

Note however that none of the Flex 4 language features or the new Spark components will be available in the project.

Choosing this checkbox sets the –compatibility-version flag on the compiler to 3.0. For more information on what this flag does, refer to this document.

I want the new Flash Builder 4 features and all the new Flex 4 language features, but I don't want to adopt the new Spark component architecture.

Migration required: Some code changes likely as Flex 4 features are incorporated; Flash Player 10 required

To make use of just the new Flex 4 language features in your existing project you can choose to use the Flex 4 SDK during the project import, but then specify that only the MX component set is available. You can do this by going Project > Properties > Flex Build Path and selecting "MX only" component set from the Library Path dialog box once you've imported the project (see Figure 7).

Select MX only component set.
Figure 7. Select MX only component set.

The new language features available to you include two-way data binding, the new States model, declarative layouts, enhanced effects, and advanced CSS.

You will notice the following behaviors in Flash Builder:

  • New documents will use the MXML 2009 namespace
  • The components panel in design view will show only MX components
  • Content assist will show only MX components
  • Halo theme will be set by default
  • Flex 4 language features are only available in documents using the MXML 2009 namespace
  • Advanced CSS is supported, however existing CSS Type selectors will need to have namespaces added (you will see compiler warnings otherwise and styles will not be applied correctly).

For more information on these features, and potential issues you may encounter whilst migrating your application, review the Flex 4 features and migration guide.

I want the new Flash Builder 4 features, all the new Flex 4 language features and I want to add Spark-based components into my existing application.

Migration required: Some code changes likely as Flex 4 features are incorporated; Flash Player 10 required

You can continue to use existing MX components alongside the newer Spark components in the same Flex application, allowing for a gradual adoption of the new component architecture. You should only replace existing MX components with Spark components if required; instead focus on using Spark components when adding new functionality to your application.

Upon importing your Flex 3 project into Flash Builder 4 and selecting to use the Flex 4 SDK, you will notice the following behaviors in Flash Builder:

  • New documents will use the MXML 2009 namespace
  • Content assist will list Spark components before MX components
  • The components panel in design view will show Spark components in documents with the MXML 2009 namespace and MX components in documents with the MXML 2006 namespace
  • Spark theme will be set by default
  • Flex 4 language features are available in documents using the MXML 2009 namespace
  • Advanced CSS is supported, however existing CSS Type selectors will need to have namespaces added (you will see compiler warnings otherwise and styles will not be applied correctly).

For more information on these features, and potential issues you may encounter while migrating your application, review the Flex 4 features and migration guide.

To learn more about what's new in Flash Builder 4, you should take a look at the following resources:

  • Five most-asked for features from developers
  • Developer productivity enhancements
  • A complete list of new features in Flash Builder 4
  • Flash Builder 4 secrets (great tips on how to be more productive)
  • Data-centric development


This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License.

More Like This

  • Migrating Flex 3 applications to Flex 4.5 – Part 4: Using Spark Panel, List, DataGrid, and VGroup components and adding custom skins and states
  • Migrating Flex 3 applications to Flex 4.5 – Part 2: Beginning migration of the Dashboard application to Flex 4.5
  • Migrating Flex 3 applications to Flex 4.5 – Part 3: Introducing Spark components and simple skins
  • 将Flex 3应用程序移植为Flex 4.5应用程序—第一部分:将Flex 3 Dashboard应用程序导入至Flash Builder 4.5
  • 将Flex 3应用程序移植到Flex 4 –第一部分:将Flex 3 Dashboard应用程序导入到Flash Builder 4
  • 面向Flex 3开发人员的Flex 4.5和Flash Builder 4.5简介
  • Migrating Flex 3 applications to Flex 4 – Part 2: Beginning migration of the Dashboard application to Flex 4
  • Migrating Flex 3 applications to Flex 4 – Part 4: Using Spark Panel, List, and VGroup components and adding custom skins and states
  • Migrating Flex 3 applications to Flex 4 – Part 3: Introducing Spark components and simple skins
  • Flex 3 与 Flex 4 之间的区别

产品

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • 移动应用程序
  • Photoshop
  • Touch Apps

解决方案

  • 数字营销
  • 数字媒体
  • 网页体验管理

行业

  • 教育
  • 金融服务业
  • 政府部门

帮助

  • 产品帮助中心
  • 订货和退货
  • 下载和安装
  • 我的 Adobe

学习

  • Adobe 开发人员连接
  • Adobe TV
  • 培训和认证
  • 论坛
  • 设计中心

购买方式

  • 在线商店
  • 批量许可
  • 查找经销商

下载

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

公司

  • 新闻编辑室
  • 合作伙伴计划
  • 公司社会责任
  • 工作机会
  • 投资者关系
  • 事件
  • 法律
  • 安全
  • 联系 Adobe
选择您的地区 中国(更改)
选择您的地区 关闭

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.

使用条款 | 隐私政策和 Cookies (更新)

京 ICP 备 10217899 号 京公网安备 110105010404