Monthly Archives: July 2009

Setting the icon color on the Halo DataGrid control in Flex 4

In a previous example, “Setting the icon color on the DataGrid control in Flex”, we saw how you could set the icon color (the sort arrow color in the DataGrid header and arrows icons in the horizontal/vertical scrollbar) on a Flex DataGrid control by setting the iconColor style.

The following example shows how you can set the icon/symbol color on a Halo DataGrid control (with default Spark skin) in Flex 4 by setting the symbolColor style.

Full code after the jump.

Continue reading Setting the icon color on the Halo DataGrid control in Flex 4

Setting the header colors on the Halo DataGrid control in Flex 4

In a previous example, “Setting the base color on the Halo DataGrid control in Flex 4”, we saw how you could set the base/theme color on a Halo DataGrid control (with the default Spark skin) in Flex 4 by setting the baseColor style.

The following example shows how you can set gradient header colors on the Halo DataGrid control (with the default Spark skin) in Flex 4 by creating a custom DataGrid header background skin and setting the headerBackgroundSkin style.

Full code after the jump.

Continue reading Setting the header colors on the Halo DataGrid control in Flex 4

Displaying different fonts in a Spark List control in Flex 4

In a previous example, “Displaying different fonts in a dropdown menu on a ComboBox control in Flex”, we saw how you could set different fonts for different items in a Flex ComboBox control’s dropdown menu by using a custom item renderer.

The following example shows you how you can display different fonts for each item in a Spark List control in Flex 4 by creating a custom item renderer.

Full code after the jump.

Continue reading Displaying different fonts in a Spark List control in Flex 4

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