The Life and Times in Carrigaline: The ActionScript 3.0 Documentation is Muck

Tuesday, July 22, 2008

The ActionScript 3.0 Documentation is Muck

Imagine, you're relatively new to Flex. You try to create an array of objects. From your Java days, you remember the java.util library contains ArrayList, which fits the bill perfectly. Now, you go to the Flex documentation, mx.collections, expecting to find something similar. The LiveDocs contain nothing, so you try Google, which give the suggestion of using mx.collections.ArrayList.

Hold on, didn't you just read the ActionScript documentation and there was no mention of ArrayList? For fun, you try importing mx.collection.ArrayList, creating an ArrayList, populating it and then print the length of the array.

import mx.collections.ArrayList;
import mx.controls.Alert;

var theList : ArrayList = new ArrayList();
theList.addItem(new Object);
theList.addItem(new Object);
theList.addItem(new Object);

Alert.show(theList.length.toString());

Surprisingly, this compiles and outputs 3 as the expected result, despite the fact there is no documentation to suggest it would work.

Labels: , , ,

3 Comments:

At July 26, 2008 at 8:44 AM , Blogger Gamma said...

Java is for n00bs... manly men use ActionScript. Men programmers don't need no stinkin' docs!

 
At July 30, 2008 at 4:36 AM , Anonymous Ambrand said...

Yerra, whats Actionscript? Perl and Javascript have served me well, why change now? :)

 
At August 6, 2008 at 12:07 PM , Blogger Carrigaline said...

ambrand: ActionScript is the programming language behind Flash and Flex.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home