

Ans:
ArrayCollection:
The ArrayCollection class is a wrapper class that exposes an Array as a collection that can be accessed and manipulated using the methods and properties of the ICollectionView or IList interfaces. Operations on a ArrayCollection instance modify the data source; for example, if you use the removeItemAt() method on an ArrayCollection, you remove the item from the underlying Array.
For example:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Script>
<![CDATA[
private function gridinitialize():void {
data.dataProvider = [
{aName:'Bikrant', DOB:'01/01/1986',
City:'Delhi', State:'NewDelhi'},
{aName:'Brijesh', DOB:'15/07/1984',
City:'Noida', State:'Uttar Pradesh'},
{aName:'Gaurav', DOB:'27/06/1989',
City:'Mumbai', State:'Maharashtra'}
];
}
]]>
</fx:Script>
<s:Panel title="DataGrid Control Example" width="428" height="409">
<mx:DataGrid id="data"
initialize="gridinitialize()"
x="12" y="12"
borderColor="#000000"
borderStyle="solid"
chromeColor="#000000"
color="#90BB2A"
fontFamily="verdana"
fontGridFitType="pixel"
symbolColor="#FFFFFF"
textAlign="center"/>
</s:Panel>
</s:Application>
Array:
The Array class lets you access and manipulate arrays. Array indices are zero-based, which means that the first element in the array is [0], the second element is [1], and so on. To create an Array object, you use the new Array() constructor . Array() can also be invoked as a function. In addition, you can use the array access ([]) operator to initialize an array or access the elements of an array.
For example:
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
[Bindable]
public var myArray:Array = ["Delhi", "Mumbai", "Chennai"];
]]>
</fx:Script>
<mx:ComboBox id="myCB0" dataProvider="{myArray}"/>
</s:Application>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.