Developer doc updates, new content, and more helpful information from the Flash Platform documentation team.

Archive for May, 2009

Applications provide updates for many reasons, including bug fixes, security patches, and new functionality. This holds true for AIR applications as well.

Adobe ships occasional update versions of Adobe AIR. And Adobe AIR applications can take advantage of new features and bug fixes in new versions of the runtime.

Also, new versions of Adobe AIR may include updated versions of WebKit (the HTML rendering engine in AIR). This may change the behavior or appearance of HTML content in an AIR application. For example, improvements or corrections in WebKit may change the layout of HTML elements in an AIR application’s user interface.

It is important to provide an update mechanism in your application. When you update your application, the application can inform the user of the new update version. Should you need to update your application due to a change in the WebKit version included in AIR, the update mechanism will let your users know about the new version of your application.

AIR includes a update framework, which simplifies the task of managing update versions and adding appropriate user interface in your AIR application.

For more information, see “Updating AIR applications” in the AIR developer’s guides:

Paul Robertson explains:

The problem is that the getItemIndex() method matches exact object references, not objects with matching properties. The first object, {label:”AK”, data”Juneau”}, may
have identical property values with the one that’s being passed to the getItemIndex() method, but they’re not exactly the same object – they’re just two different objects that happen to have the same property values.

To get a match with getItemIndex(), you need to pass a reference to the actual object that’s in the data provider. To do that, of course, you need a reference to the
same object, for example in a variable. Here’s a variation of your code that works:

Of course, you are probably really trying to do some sort of search to find the index of an item that matches a user entered string. The only way I can see to do that is to loop over the data provider one item at a time and compare the property values. You can either loop over the data provider directly using dp.length anddp.getItemAt(index), or else keep the objects in a separate array. This code demonstrates the first approach: