Tag Archives: needsSWF

Formatting values in an FxNumericStepper control using a custom display format function in Flex Gumbo

The following example shows how you can format the value displayed in a Flex Gumbo FxNumericStepper control by setting a custom display format function using the displayFormatFunction property.

The displayFormatFunction property was added in build 4228. Download Adobe Flex Gumbo SDK.

Full code after the jump.

Continue reading Formatting values in an FxNumericStepper control using a custom display format function in Flex Gumbo

Incrementally 3D rotating objects using the Spark Rotate3D effect in Flex 4

In a previous example, “3D Rotating objects in Flex 4 using the Spark Rotate3D effect and Flash Player 10”, we saw how you could rotate objects in 3D space from 0 to 360 degrees along the X, Y, and Z axis using the Spark Rotate3D effect in the Flex 4 SDK.

The following example shows how you can rotate an image relative to its current rotation by setting the yBy property on the Spark Rotate3D instance.

Full code after the jump.

Continue reading Incrementally 3D rotating objects using the Spark Rotate3D effect in Flex 4

Previewing an image before uploading it using the FileReference class in Flash Player 10

The following example shows how you can browse for an image file from your local file system and preview the image before uploading it to a remote webserver by using the FileReference class’s new load() method in Flash Player 10. Once the user has browsed and selected an image from their local machine, you can call the load() method which dispatches a complete event when the image has successfully loaded, at which point you can display the image using a Flex Image control and setting the Image instance’s source property to the FileReference class’s data property (which is a ByteArray).

Full code after the jump.

Continue reading Previewing an image before uploading it using the FileReference class in Flash Player 10

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