Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<?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