passing an String array as an argument JS

Hi,
I have script-A which has an array in it, like :

var testArray : int[];
var bullet : Transform;

function Update()
{
   testArray = new Array(2);
   testArray[0] = 4;
   testArray[1] = 7;
   if (Input.GetKeyDown (KeyCode.KeypadEnter))
   {
        bullet.BroadcastMessage("fire", testArray)
   }

}

This is Script-B which is attached to another game object. I don’t know how to pass an test Array as an arrgument

//SCRIPT-B

var bulleCount : int[] ;
function Update()
{
     bulleCount = new Array(2);
}

function fire ( receivedData : int[] )   // ???????????????
{
     bulleCount = receivedData;
}

This doesn’t work. Does anyone have any idea? How can I pass the testArray to fire function as an argument?

It probably does work but you’re declaring testArray as an int[ ] and then trying to initialize it as an Array. They’re not the same thing.

Also, never use Array. Use only built-in arrays like int[ ], or else use generic Lists if you’re adding/removing elements.

–Eric