Creating an object pool . Facing problem with array

I am creating an endless runner game where i want to reuse the prefab platforms.
At first I am copying the drag and dropped prefabs into an array “DEACTIVATED_HOLDER”
When the game begins i want to call a function to select a prefab at random from this
array and move it to ACTIVATED_HOLDER array after activating the gameobject.
I have run into a few problems .Could you please guide me how do i progress ? thnx in advance (:

#pragma strict
@script ExecuteInEditMode();
var array_status : GUIText ;

var prefabPlatform : GameObject[];
static var deactivated_holder : Array ;
static var activated_holder  : Array ;
static var postionMultiplier=0 ;
var prefabwidth=300;
static var check=0;


function Start () {
deactivated_holder=new Array ();
var activated_holder = new Array ();
var new_prefab : GameObject ;
for(var i=0;i<prefabPlatform.length;i++) // MOVING ALL THE DRAG AND DROPPED PREFABS FROM prefabPlatform to deactivated_holder
{
new_prefab=Instantiate(prefabPlatform_, Vector3(0, 0, postionMultiplier*prefabwidth), Quaternion.identity);_

new_prefab.name=“Platform_”+(i+1);
new_prefab.gameObject.active=false;
deactivated_holder.Push(new_prefab);
}
relocate_prefab();
}

function Update () {}

function relocate_prefab() // Here i want to fetch a gameObject from the array at random and push it

  •  					// into the activated_holder after activating the prefab* 
    

{
var z_coordinate_generation=postionMultiplier*prefabwidth ;
var to_be_activated_prefab=deactivated_holder[Random.Range(0,deactivated_holder.length)];
print(“z:”+z_coordinate_generation+“,”+to_be_activated_prefab.);
to_be_activated_prefab.gameObject.active=true;
to_be_activated_prefab.transform.position(0,0,z_coordinate_generation);
}

I AM NOT ABLE TO FETCH THE GAMEOBJECT FROM DEACTIVATED_HOLDER AND POSITION IT

Don’t use Array.Push(). Use a List<> instead (Dynamically re-sizable collection). I don’t believe Array.Push() works in Unity the same way it works in normal Javascript so this might be the reason you cannot access the GameObject.