;

PDA

Click to See Complete Forum and Search --> : array looping & getAttributes & syntax


nyls
04-27-2001, 06:47 AM
Well i,m trying to get Data in a var string out of an xml by looping through a array ; see example
It works if I type in bv.
string = symbolAtrributes.x_pos;

but
string = symbolAtrributes.eval(itemAttributesArray[h]);
or
string = symbolAtrributes.itemAttributesArray[h];

doesn't work??


example;

var itemAttributesArray = new Array('type','id','date','x_pos','y_pos')


for(h=0; h < itemAttributesArray.length;h++){
string = symbolAtrributes.eval(itemAttributesArray[h]);
}

nyls
05-02-2001, 11:46 AM
well got the answer at the flash 5.0 Actionscript board- THNX -- here is the correct syntax for all you thread readers --


var itemAttributesArray = new Array('ss','ss',)

for(h=0;h<itemAttributesArray.length;h++){
string = symbolAtrributes[itemAttributesArray[h]];
}