-
scripting Q: simple for loop, how to read the counter as a number ?
Trying this simple for loop to set the inPoint of 10 layers by this TravelDuration array;
var TravelDuration = [1.5,2.5,3.5,2.5,2,3.5,2,1.5,1,2];
for (var e=0;e<=TravelDuration.length;e++){
var inn=0;
inn = TravelDuration[e];
infoComp.layer(e+1).inPoint=inn;
};
///
the error are “undefind inPoint” or “NaN is not a number” …When replacing to a number( inn = 1 ) the script works fine setting all my layers inPoint’s to 1sec.
tried this :
//
inn = parseFloat(TravelDuration[parseInt(e.toString())]);
///with variation, but i cant get it to read // TravelDuration[e] // for the array position(0-9 );
what am I missing?
Thanks
var TravelDuration = [1.5,2.5,3.5,2.5,2,3.5,2,1.5,1,2];
for (var e=0;e<=TravelDuration.length;e++){
var inn=0;
inn = TravelDuration[e];
infoComp.layer(e+1).inPoint=inn;
};