QUOTE(ronviers @ 02/05/08, 02:02 PM) [snapback]280647[/snapback]
int $channelIndex=2;
int $valueIndex=3;
Your initial values should be one less (remember arrays start at index# 0)
int $channelIndex=1;
int $valueIndex=2;
Edit: Also take a look at setAttr command there should be no need to use loops