Archive for August, 2011

Dynamically changing the series of a Flex chart may fail

I think I found a bug, but I’m too lazy to file it right now.

I’m using a Flex LineChart that has to display a variable amount of LineSeries instances. Each LineSeries is assigned a datafunction to display its data. Now the strange thing is, that if you change the series of the LineChart, the removed LineSeries still evaluate their datafunction. This may not be a problem since it won’t display the removed LineSeries anyway, but I had a rather complex datafunction that ran into a run time error.

If you don’t want the removed LineSeries to evaluate their datafunction, just set the datafunction property to null.


for each (var lineSeries:LineSeries in chart.series) {
   lineSeries.dataFunction = null;
}

var newSeries:Array;
// Create new series here ....

chart.series = newSeries;

No Comments

Merging directories on Mac

To install the AIR sdk 2.7 on Flash Builder 4.5.1, you have to:

- copy all sdk 2.7 files to the existing sdk 2.6 directory (and, if applicable, overwrite sdk 2.6. files with correspondingĀ  sdk 2.7 files)
- keep every sdk 2.6 files in place for which there is no corresponding sdk 2.7 file

On Windows this seems to be no problem: just copy the sdk 2.7 directory to the parent directory of the sdk 2.6 directory, and you are done. On Mac, however, the sdk 2.6 directory is replaced by the sdk 2.7 directory, leaving an incomplete sdk, since a number sdk 2.6 files have to remain in place. If you want your Mac to behave like a Windows (yes, it does happen!) you have to resort to the terminal and use the ditto command:

ditto <source directory> <destination directory>

No Comments