Category Archives: Flex SDK

Downloading and installing Flex 4 SDK builds from opensource.adobe.com (Flash Builder 4 beta Edition)

In a previous example, “Downloading and installing Flex SDK builds from opensource.adobe.com”, we saw how to install a nightly build of the Flex SDK from opensource.adobe.com and install it into Flex Builder 3.

The following example shows how you can download and install a nightly build of the Flex 4 SDK into Flash Builder 4 (formerly Flex Builder).

Downloading and installing Flex 4 SDK builds into Flash Builder 4 (formerly Flex Builder)

  • To download the Flex 4 SDK, navigate to the following URL:
    http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4/.
  • Download the latest nightly build. You can download either of the available SDK types (Adobe Flex SDK, Open Source Flex SDK, or Adobe Add-ons — see the “Downloading and installing Flex SDK builds from opensource.adobe.com” for explanations between the different types). For this example I am downloading the latest nightly build of the Adobe Flex SDK (currently 4.0.0.8520).
  • Save the nightly build to your hard drive and extract the files from the .ZIP file.
  • In Flash Builder 4, select Window > Preferences from the main menu to open the Flash Builder Preferences dialog box. To add, edit, or remove a Flex SDK, select Flash Builder > Installed Flex SDKs.
  • Click the Add button to launch the Add Flex SDK dialog box and click the Browse button to navigate to the directory where you extracted the nightly SDK build in a previous step.
  • Click OK to apply your changes and add the new Flex SDK. If you want to set the newly downloaded SDK as your default SDK, click the check box to the left of the SDK name. Click OK to dismiss this dialog.

Q: I get an “unable to open ‘…/frameworks/libs/netmon.swc'” error after changing my Flex SDK.
A: If you are trying to use a nightly build with the Flash Builder 4 beta from Adobe Labs, you’ll likely get this error. Currently you’ll either need to disable network monitor for the current Flex project, or else copy an existing netmon.swc into your new SDK.

(a) Disabling network monitor:

  • In Flash Builder 4, select your Flex project and select Project > Properties from the main menu to open the project properties dialog box.
  • Select Flex Compiler from the left menu, and then deselect the “Enable network monitor” checkbox in the Compiler options area.
  • Click OK to apply changes and dismiss this dialog box.

(b) Copying netmon.swc from an older Flex SDK:

If you want to use the network monitor with a newer, nightly build of the Flex 4 SDK, you can copy the netmon.swc from the Flex 4.0.0.7219 SDK that shipped with the Flash Builder 4 beta.

  • Launch Windows Explorer or Mac Finder app and navigate to your Adobe Flash Builder 4 application folder. On Windows Vista, the SWC would be found at C:\Program Files (x86)\Adobe\Adobe Flash Builder Beta\sdks\4.0.0\frameworks\libs\netmon.swc.
  • Copy that netmon.swc into your nightly build’s /frameworks/libs/ folder.

The network monitor issue has been fixed in newer (internal) versions of Flash Builder 4, so these steps will no longer be needed in future drops of Builder. For more information, see http://bugs.adobe.com/jira/browse/FB-20542.

Q: I get a “An internal build error has occurred. Right-click for more information.” compiler error after changing my Flex SDK.
A: Most likely you’ll need to close Flash Builder 4 beta and relaunch it to remove this error. This has also been fixed in newer (internal) versions of Flex Builder 4. For more information, see http://bugs.adobe.com/jira/browse/FB-19867 and http://forums.adobe.com/message/2093853#2093853.

Q: It says that API ___ no longer exists. Do you know what the replacement is?
A: Check out the list of Flex 4 SDK API renames for SDK builds after 4.0.0.7756 (Monday, June 15th week). The Flex SDK 4 beta 1 SDK was 4.0.0.7219. http://opensource.adobe.com/wiki/display/flexsdk/Rename+List

Using the beta Flex 4 SDK in Flex Builder 3

In a previous entry, “Downloading and installing Flex SDK builds from opensource.adobe.com”, we saw how to download and install nightly builds of the Flex 3 SDK into Flex Builder 3.
Setting up the beta Flex 4 SDK has a couple little “gotchas” which can be a little tricky.

  1. Download the latest Flex 4 SDK nightly build from opensource.adobe.com and extract the files in the .ZIP archive to your hard drive.
  2. Follow steps 4 through 6 in the “Downloading and installing Flex SDK builds from opensource.adobe.com” entry to add the Flex SDK build to Flex Builder.
  3. Create a new Flex project in Flex Builder 3.
  4. Select Project > Properties in Flex Builder’s main menu to launch the Project Properties dialog box. Select Flex Compiler from the left menu, click the Use a specific SDK radio button, and select the Flex 4 SDK you added in the previous step.
  5. In the HTML wrapper section of the Flex Compiler settings dialog, set the required Flash Player version to 10.0.0 (see Figure 1). Click OK to close this dialog box.

Flex Builder Project Properties dialog box

Figure 1. Flex Builder Project Properties dialog box.

If you forget to change the Flash Player detection to Flash Player 10, you may see the following compiler errors in your Flex Builder Problems tab:
1046: Type was not found or was not a compile-time constant: ContentElement.
1046: Type was not found or was not a compile-time constant: ElementFormat.
1046: Type was not found or was not a compile-time constant: FontMetrics.
1046: Type was not found or was not a compile-time constant: GroupElement.
1046: Type was not found or was not a compile-time constant: TextElement.
1046: Type was not found or was not a compile-time constant: TextLine.

If you haven’t already installed the Flash Player 10 beta yet, you can find the various installers in the downloaded SDK’s /runtimes/player/10/{OS}/ directory.

Now that you have the Flex 4 SDK and Flash Player 10 installed, now it’s time to write a simple test file using the latest Flex SDK.

Full code after the jump.

Continue reading Using the beta Flex 4 SDK in Flex Builder 3

Downloading and installing Flex SDK builds from opensource.adobe.com

The Flex SDK is constantly changing and improving. Every day bugs are getting fixed, features are being added or improved. If you want to use the latest code, you’ll need to know where to download the Flex SDK from and how to add the new SDK to Flex Builder.

New builds of the Flex SDK can be downloaded from the Flex SDK Downloads page on the opensource.adobe.com site. Currently, this page gives you links to download the latest Gumbo nightly build, the latest Flex 3 nightly build, or the various Flex 3 Compiler Modules. There are three main SDK build types:

  • Latest Milestone Release Builds — Releases are builds that have been declared major releases by the development team – Releases are the right builds for people who want to be on a stable, tested release, and don’t need the latest greatest features and improvements. There are generally a few milestone releases on a given branch and will be signified by incrementing the first minor number (e.g., 3.1).

    The Flex team creates signed versions of the major RSLs for every milestone release.

  • Stable Builds — Stable builds have been found to be stable enough for most people to use. They are promoted from nightly build by the architecture team after they have been used for a few days and deemed reasonable. The latest stable build is the right build for people who want to stay up to date with what is going on in the latest development stream, and don’t mind putting up with a few problems in order to get the latest and greatest features and bug fixes. The latest stable build is the one the development team likes people to be using because of the valuable and timely feedback; however it should be understood that the only fully supported versions are milestones (e.g., Adobe technical support supports milestones, though may point to fixes in stable builds) . The development team attempts to put out a stable build on active branches within 60 days of each other. Stable builds are signified by incrementing the second minor number (e.g., 3.0.1).

    The Flex team dos not currently create signed versions of the major RSLs for stable builds as it would begin negating the value of the framework cache (that said, we’ll be keeping an eye on things and re-evaluating as necessary).

  • Nightly Builds — Nightly builds are produced every night from whatever has been released into the HEAD of the SVN repository. They are untested and may have problems. Some possibly will not work at all. These drops are normally only useful to developers actually working on the Flex Project, but may be used to monitor how a given feature is progressing. Nightly builds follow the numbering of the last stable build, with only the third minor number incrementing (and matching the last revision number from Subversion).

[source opensource.adobe.com: SDK Build Types]

The next important thing to understand is the different types of Flex SDKs available:

  • Free Adobe Flex SDK — An official Adobe product, with released versions found at http://www.adobe.com/go/flex3_sdk. The Adobe Flex SDK contains everything you will need to build and deploy Flex RIAs. It is licensed under the Adobe Flex SDK license because it contains a mixture of open and closed source components (see license info above). The Flex framework source code included in this package is called out explicitly as licensed under the MPL. However, if you want just the open source stuff, you should look at the Open Source Flex SDK.
  • Open Source Flex SDK — For users who want a package that contains only open source code, we offer the Open Source Flex SDK, which is available from this site. This package is entirely under the MPL, including its binaries. It contains the majority of the Flex SDK (compilers, framework, debugger) but does not include anything that is not open source like the Adobe Flash Player, Adobe AIR, or the advanced font encoding libraries. This SDK is capable of creating Flex applications and can be used in whatever fashion the MPL allows. If you have questions regarding the use of code licensed under the MPL, you should consult with an attorney.
  • Adobe Add-ons for Open Source Flex SDK — This package contains all of the items that are in the Adobe Flex SDK and not in the Open Source Flex SDK. Downloading this file will allow you to bring the Open Source Flex SDK to parity with the Adobe Flex SDK. This package includes the Adobe Flash Player, Adobe AIR, the advanced font encoding libraries, and the code that allows licensing of things like the Data Visualization components. All of these elements are licensed under the Adobe Flex SDK license.

[source opensource.adobe.com: Flex SDK Downloads]

Downloading and installing Flex SDK builds into Flex Builder 3

  1. To download the Flex 3 SDK, navigate to the following URL:
    http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3/
  2. Download the latest nightly build. You can download either of the available SDK types (Adobe Flex SDK, Open Source Flex SDK, or Adobe Add-ons — see the previous list for explanations between the differnt types). For this example I am downloading the latest nightly build of the Adobe Flex SDK.
  3. Save the nightly build to your hard drive and extract the files from the .ZIP file
  4. In Flex Builder 3, select Window > Preferences from the main menu to open the Flex Builder Preferences dialog box. To add, edit, or remove a Flex SDK, select Flex > Installed Flex SDKs.
  5. Click the Add button to launch the Add Flex SDK dialog box and click the Browse button to navigate to the directory where you extracted the nightly SDK build in a previous step.
  6. Click OK to apply your changes and add the new Flex SDK. If you want to set the newly downloaded SDK as your default SDK, click the check box to the left of the SDK name. Click OK to dismiss this dialog.

That’s it! You’ve successfully downloaded and installed the latest and greatest version of the Flex SDK into Flex Builder.

If you want to compile your code against this new SDK you can select Project > Properties from the main menu, select Flex Compiler from the menu on the left, and select your new SDK from the dropdown menu in the Flex SDK version section.

Also worth mentioning is that you can manage your installed SDKs via the Project Properties dialog menu by clicking the Configure Flex SDKs link, which takes you to the Installed Flex SDKs preferences.

Happy Flexing!