GameObject info

Hello,

I'm working on an inventory for my game and I am adding itmes(game object) in an array, from there I whant to access a javascript to get some variables from there

can anyone tell me how can I do that? I tried everything I could think ...

Inventory.populate(gameObject.Find("Rifle"));

//this is the functin from Inventory.js
static function populate(item:GameObject){
    items.push(item);
}

//

for(var i=0;i<items.length;i++){
    var itm:GameObject=items*;*
 *print(itm.transform.Find("itemDetails"));* 
*}*
*```*
*<p>Thanks</p>*

Do you mean you want to access a custom script called ItemDetails for every item?

for(var i = 0; i < items.length; i++) {
    var item : GameObject = items*;* 
 *var details : ItemDetails = item.GetComponent("ItemDetails");* 
 *// use details*
*}*
*```*

It was with small i, I've changed the name, now I can get the script but can't access any variables from the script, I even made a function that returns my variable...

Anyway thanks a lot for your answer