arrays / textures help

ok i have 2 arrays lets say

x:GameObject[] = new GameObject[4]

and then i have

y:Texture[] = new Texture[4]

how do i access the gameObjects Textures in “x” to display them in “y”.

sorry, just trying my best to do scripting BTW its in javascript,

thanks in advance to those who will answer.

To access an object’s main texture you go through the renderer’s material.

for (var i = 0; i<x.Length; i++) {
    y _= x*.renderer.material.mainTexture;*_

}
You can also go by the property name in the shader by using the [GetTexture-function][1]:
var tex : Texture = renderer.material.GetTexture (“_BumpMap”);
Remember that the array y doesn’t have to be public, you could make it static or private (depending on your need for access level) and resize it before you iterate through the x array.
y = new Texture[x.Length];
_*[1]: http://docs.unity3d.com/Documentation/ScriptReference/Material.GetTexture.html*_