You are viewing the Articles in the News Category

Adobe Thermo?

So what exactly is Adobe Thermo? Or at least what is this new product from Adobe which has been codenamed “Thermo”? I don’t think anyone outside of Adobe really knows for sure just yet…

Based on what I have read so far “Thermo” appears to be a cool new tool which will allow creative professionals to leverage their existing skills to build RIAs utilizing tools they are comfortable with such as the Adobe Creative Suite product line.

Regardless of the specifics, one thing is for certain – any new tool which builds on the Adobe Flash Platform can only be a good thing for RIA developers specializing in Adobe technologies.

So I guess we will just have to wait for MAX 2007 / Chicago in 2 weeks to find out more.

For more information check out Mark Anders post on Thermo.

ComboBox.prompt

This is one of those little things that you come across from time to time and think to yourself, “man, how did I not come across this before?”.

There has been so many times where I have added an item to a collection in order to display a message to the user. For instance, say you have a ComboBox that displays a list of employees and you want to add a message as the first item, specifying something to the extent of “Select an employee”. Typically, an item would need to be added to the dataProvider of the ComboBox at index 0. Then the issue arises where you will then need to take this item into account when it is selected so that it will be ignored.

Well, like most things in Flex there is an out of the box solution!

The solution is the prompt property which can be utilized to facilitate exactly this sort of thing. I stumbled across this property accidentally while extending ComboBox and viewing the source code. The prompt property simple adds an item to it’s data provider at -1. Since Array indexing begins at zero, this item is ignored and you do not have to take it into account when working with the data provider.

Hope this helps someone down the road.

AS3 HashMap Update

I have updated the HashMap API to provide additional functionality which comes in handy when working with managed key / value pairs.

Additionally, I have also modified the HashMap class from an “is-a” to a “has-a” relationship as the previous version was a derivation of Dictionary, thus exposing the map and consequently causing a security breach in the API. This has been fixed as of this update as the map is now private rather than the object itself.

The original IMap interface I created was modeled loosely after operations which are typical of the Java Map interface. However I have identified additional operations which are useful when working with key / value pairs. These new operations have been implemented in the latest HashMap class and comprise all of the new methods.

Below is a list of the additional methods which have been implemented in the HashMap update:

  1. getValues: Retrieves all of the values assigned to each key in the specified map
  2. reset: Resets all key assignments in the HashMap instance to null
  3. resetAllExcept: Resets all key / values defined in the HashMap to null with the exception of the
    specified key
  4. clearAllExcept: Clears all key / values defined in the HashMap to null with the exception of the specified key

You can view the latest HashMap API source for the IMap interface and HashMap implementation. Each method is accompanied by a detailed example.

AS3 BinaryConversion Utility

There are certain utility classes one would expect to have been included as part of the Flash Player API or the Flex framework, however they do not always exist.

For instance, I have been working with binary data and needed an API which would convert Decimal Numbers to their Binary equivalents, however after spending some time searching the packages on livedocs I realized that nothing had been provided. So I decided to roll my own.

The BinaryConversion utility is an all static class which will convert decimal numbers to their 4, 8, 16 or 32-bit binary equivalents, respectively. For the most part you may never need to use this API unless you need to convert decimal numbers to specific binary equivalents, however it is very useful if you need a quick Decimal to Binary conversion utility which also provides bit range validation.

You can view the BinaryConversion example as well as the source code.

BinaryConversion is protected under the MIT license.

Flex 3 ResourceInspector

Adobe Flex 3 introduces the ability to implement runtime localization via compiled resource modules. This opens up numerous possibilities for creating localized applications with Adobe Flex.

Flex Developers now have the ability to compile resources into resource modules rather than compiling the resources into the application directly. Resource modules can be preloaded for the appropriate locale when the application starts as well as loaded at runtime in order to allow switching of locales. Additionally, resources can be compiled for multiple locales into a single application or resource module.

Resources now must be accessed through the new ResourceManager (which is very similar to my original Flex 2 ResourceManager), which handles managing multiple resources for all locales.

Bindings which reference resources via the new ResourceManager automatically update if the locale changes so as to notify the components when the locale changes, allowing them to update themselves appropriately. You can also use images, sounds and so forth as resources.

Developers can programatically create resources at runtime and use them just as one would with resources which were compiled from properties files, thus allowing the ability to create resources at runtime from downloaded XML documents, service results, etc.

The ability to inspect ResourceBundles at runtime has been something which I have been specifically waiting for. This too is also available via the read-only content property on a ResourceBundle. This property can be used to retrieve the key / value pairs defined in a .properties file.

To help facilitate inspecting the contents of a ResourceBundle I have created a ResouceInspector API which provides a detailed view into a ResourceBundle. The ResouceInspector is an all static class which provides a very robust API for performing detailed inspection of the contents of a ResourceBundle.

ResouceInspector is protected under the MIT license. Check it out here.

DynamicBindingChain API for Flex

One of the most powerful and convenient features of Flex is data binding. Data binding is the process of tying the data in one object (the source) to another object (the destination). Data binding can be used at compile time via the [Bindable] meta data tag and at runtime via the mx.bindings.utils API.

The mx.bindings.utils API provides a mechanism for dynamically applying data binding to an object. However, it does not provide a means for managing a specific data binding chain as a single unit.

The DynamicBindingChain API provides developers with a basic, yet robust API which allows multiple objects in a data binding chain to be managed. It provides a wrapper interface into the mx.bindings.utils API allowing objects to be added to a data binding chain, removed from the chain, validated against the property criteria in the chain as well as other methods for working with a managed data binding chain.

I have provided an example demonstrating some of the features available in the DynamicBindingChain API. In the example,  four TextArea objects text properties are dynamically bound and unbound to a TextInput objects text value.

Click here to view an example of the DynamicBindingChain. You can also view the source as well as the accompanying ASDoc.