Category Archives: ActionScript

Parsing dates with timezones in Flex

In a previous example, “Parsing ISO dates with Flex and ActionScript”, we saw how to parse ISO formatted dates (2008-01-25T06:14:23Z) and convert them into an ActionScript 3.0 Date object.

The following example shows how you can convert a Java formatted date (Wed Jul 22 14:29:30 PST 2009) and convert the timezone into an ActionScript 3.0 friendly format (UTC-0700) so you can use the static Date.parse() method to convert them into an ActionScript 3.0 Date object.

Full code after the jump.

Continue reading Parsing dates with timezones in Flex

Determining your Flex SDK version number

The following example shows how you can determine your Flex SDK version within a Flex application by using the internal mx_internal::VERSION property.

You can also find the version number by doing one of the following:
(a) Viewing the flex-sdk-description.xml file in your Flex SDK’s root directory:

<?xml version="1.0"?>
<flex-sdk-description>
    <name>Flex 4.0</name>
    <version>4.0.0</version>
    <build>3934</build>
</flex-sdk-description>

(b) At a command prompt, navigate to your Flex SDK’s /bin/ directory and type mxmlc -version:

C:\\dev\\flexSDKs\\4.0.0.3934\\bin>mxmlc -version
Version 4.0.0 build 3934

Full code after the jump.

Continue reading Determining your Flex SDK version number

Dynamically styling error tips in Flex

In a previous example, “Changing the background color of an error tip in Flex”, we saw how you could change the background color of a Flex error tip by setting the borderColor style on the .errorTip CSS selector.

The following example shows how you can style the Flex .errorTip style dynamically using ActionScript using the static StyleManager.getStyleDeclaration() and setStyle() methods.

Full code after the jump.

Continue reading Dynamically styling error tips in Flex