Skip to content

Instantly share code, notes, and snippets.

@lukesh
Created June 13, 2009 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukesh/129284 to your computer and use it in GitHub Desktop.
Save lukesh/129284 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="handleCreationComplete(event)"
>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var arrayCollection:ArrayCollection;
[Bindable]
public var primitiveArray:Array;
private function handleCreationComplete(event:Event):void {
arrayCollection = new ArrayCollection();
primitiveArray = [];
for (var i:uint = 0; i < 10; i++) {
arrayCollection.addItem("testing " + i.toString());
primitiveArray.push("testing " + i.toString());
if (i == 4 || i == 8) {
arrayCollection.addItem("something");
primitiveArray.push("something");
}
}
}
]]>
</mx:Script>
<mx:HBox>
<mx:List width="100" height="300" dataProvider="{primitiveArray}" />
<mx:List width="100" height="300" dataProvider="{arrayCollection}" />
</mx:HBox>
</mx:Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment