resizing array[] erases its values to Vector3(0,0,0)

I coded a loop that looks for the tiles surrounding a tile that is clicked , and if one is found, the foundtiles array is resized,and a new tile position is added as the last value.

if I print the 4 tiles positions from the array within the loop, I get 4x positive Vector3 values, but if I print values from the array after the loop they are all 0, 0, 0 except the last one written which is positive, which means that the data in the array is being raised when I resize it.

here’s the code:

		if (Physics.Raycast (ray, hit, 1000))
		{
			var objectposition = hit.collider.transform.position;
			for (var w1:int = 0; w1 < 4; w1 ++) {
				for (var upwall in upwalls)
					{
						if (upwall.transform.position== petalvectors[w1]* sizemultiplier+objectposition)
						{
							 z4=z4+1; 
							 foundwalls = new Vector3[z4];
							 foundwalls[z4-1] = petalvectors[w1]* sizemultiplier+objectposition;
//print( foundwalls[z4-1]+ "zero"+foundwalls.length);prints 4x values							 
						}
					}
				}
print( foundwalls[1]+ "zero"+foundwalls.length);prints (0,0,0) except for foundwalls[3] the last written

if I am doing it wrong, how am I supposed to resize it?

oh dam it looks like i should have looked for this question before asking, sorry: