Archive for July, 2008

Flex Gumbo API Reference available

The ASDoc API reference for Flex Gumbo, the next version of Adobe Flex, is now available at http://livedocs.adobe.com/flex/gumbo/langref/. We will be updating this reference approximately every other week.

Please use the Adobe Forums to comment on the API reference.

For general information about Gumbo, see the Gumbo page.ᅠ

Draft Documentation for Flex and Flash Accessibility

Andrew Kirkpatrick has posted some draft documentation for the Flash Accessibility APIs. This is important information for anyone who builds components that need to be accessible, or is curious about how Flex implements all of its accessibility support.

Please make sure to post comments or bugs to Andrew’s post, to this post, or in JIRA.

Download the ZIP file from Adobe Share

LiveCycle Data Services ES 2.6 documentation

We are happy to announce that LiveCycle Data Services ES 2.6 was just released and includes many documentation improvements. Much of the documentation has been revised and reorganized, and there are completely new sections on:
Getting Started
- Introduction
- Building and deploying

Architecture
- General architecture
- Channels and endpoints
- Managing session data

You can get the documentation here:
http://www.adobe.com/support/documentation/en/livecycledataservices/

The main product page is here:
http://www.adobe.com/products/livecycle/dataservices/

Thanks go out to the LiveCycle Data Services development and quality engineering teams, who put a great effort into shaping and reviewing this content. Special thanks go to Mete Atamel, Seth Hodgson, Ed Solovey, and Jeff Vroom for their contributions.

Learn About Gumbo: The Next Version of Flex

Gumbo is the code name of the next version of Flex. New information about Gumbo has been made available on the Gumbo page of the Flex Open Source site.ᅠ

Highlights of the new information about Gumbo include the following:

1. Themes of the Release
Gumbo is being planned around three primary themes:

  • Design in Mind
    A framework for continuous collaboration between designer and developer.
  • Developer Productivity
    Improve compiler performance and add productivity enhancements.
  • Framework Evolution
    Take advantage of the new Flash Player capabilities and add features required by common use-cases.

2. Recorded Presentations

3. White Paper: An Introduction to the Gumbo Component Architecture
This white paper provides a comprehensive look into our plans for the next version of Flex.

4. Gumbo Feature Specifications
Read, and comment on, the recently published specifications for Gumbo. Currently, there are eight specs available, with more on the way.

Customizing the layout of legend items

This question came up in a recent forum posting:

You can make the LegendItems in a Legend display horizontally in a long line or vertically in a long list, but how do I customize the layout of these LegendItems?

The answer took me a little while to figure out, so I’ll post it here so others can benefit from it… Yes, the answer is also posted as a response in the forums, but I can put running examples here so you can see what I mean.

First, an app that shows the problem. The ColumnChart control in the following app has 7 separate series, each with a separate entry in the legend. If you lay out the LegendItems vertically, you get a lot of extra white space to the right of the legend, below the chart, as the following example shows:

If you lay the LegendItems out horizontally, you get scroll bars at the bottom of the application, as the following example shows:

There’s no way (that I could figure out) to eliminate those scroll bars without clipping the LegendItems.

One solution, which can be adapted to any number of layout techniques, is to build the list of LegendItems in ActionScript and add them to a dynamic grid layout. I did this in a single loop that takes into account the preferred number of items per row:

for (var j:int = 0; j < numRows; j++) {
var gr:GridRow = new GridRow();
myGrid.addChild(gr);
for (var k:int = 0; k < rowSize; k++) {
if (z < myChart.series.length) {
var gi:GridItem = new GridItem();
gr.addChild(gi);
var li:LegendItem = new LegendItem();
// Apply the current series' displayName to the LegendItem's label.
...
// Get the current series' fill.
...
// Apply the current series' fill to the corresponding LegendItem.
...
// Add the LegendItem to the GridItem.
gi.addChild(li);
// Increment any time a LegendItem is added.
z++;
}
}

Before you do any of this, you have to remove all the existing GridRows and GridItems. You do this with a call to the removeAllChildren() method, like this:

myGrid.removeAllChildren();

There are a couple of gotchas in this approach: you have to be sure to grab the right labels so that your dynamic LegendItems match the series’ display names that show up in the chart. You do this by accessing the chart’s series array’s displayName property, as the following example shows:

li.label = myChart.series[z].displayName;

You also have to get the color (actually, it’s the “fill” property) from the series, and apply it to the corresponding LegendItem’s fill, as the following example shows:

var sc:SolidColor = myChart.series[z].getStyle("fill");
li.setStyle("fill", sc);

Here’s a running example that lays out the LegendItems in the selected number of rows. I also took the opportunity to apply some styles to make the LegendItems a little more attractive. They are of uniform width and their background colors are the same as the marker color, as the following example shows:

li.setStyle("textIndent", 5);
li.setStyle("labelPlacement", "left");
li.setStyle("fontSize", 9);
gi.setStyle("backgroundAlpha", "1");
gi.setStyle("backgroundColor", sc.color);
gi.width = 80;

Here’s the running example:

Here’s the source code:
Download ZIP (9K)