arraylist to array

i am trying to assign an array named scrollobjects which is of gameobject type, the items of arraylist.
here is the code.::

 for(i=0;i<numberOfPlanes;i++)
    {
    GameObject pup = Instantiate(popUpPlane,new Vector3(i*nextPlaneXoffest,-2.66f,0),Quaternion.Euler(-90,0,0)) as GameObject;
    pup.GetComponent<PopUpButtonScript>().initialize(15);
    instantiatedPlane.Add(pup);
    }

Camera.mainCamera.GetComponent<ScrollList>().scrollObjects=(GameObject[])instantiatedPlane.ToArray(typeof (GameObject)); 

here instantiated plane is a arraylist and scrollobjects is an array of gameobjects.

when i am doing debug.log(scrollObjects.length) it is returning 0;

meaning no object of arraylist is being assigned to array scollObject…

why is this so…??
how to do so…??

any help would be appriciated…!!
thanks

Try this:

for(i=0;i<numberOfPlanes;i++)
    {
    GameObject pup = Instantiate(popUpPlane,new Vector3(i*nextPlaneXoffest,-2.66f,0),Quaternion.Euler(-90,0,0)) as GameObject;
    pup.GetComponent<PopUpButtonScript>().initialize(15);
    instantiatedPlane.Add(pup);
    }

Camera.mainCamera.GetComponent<ScrollList>().scrollObjects = instantiatedPlane.ToArray() as GameObject[];

Sundar almost had it, he was just missing the type cast at the end. If your debug check still outputs 0 then that means your for loop isn’t getting executed. Put a debug statement in there just verify that too.