Skip to main content
Known Participant
March 7, 2023
Answered

strange error in expression loop. any ideas?

  • March 7, 2023
  • 1 reply
  • 460 views

Expression loops through a series of effects by name: line1, line2, line3, line4, line5. 

Getting an error at i=6, which should not be possible based on the loop's break conditions. Any ideas?

 

 

// loop through the lnes
for ( i=1; 1<=5; i++ ) {
	lineName = "line" + i;
	lineEmojiEffect = emojiComp.effect(lineName)("3D Point");
	lineEmojis = [ parseInt(lineEmojiEffect[0]),  parseInt(lineEmojiEffect[1]), parseInt(lineEmojiEffect[2]) ];
	if (emojiNum in lineEmojis) {
		lineNum = i;
		printY =  thisComp.layer("line"+lineNum).transform.position[1];
	} else {
		printY = 0;
	}
}

 

 

 

 

 

This topic has been closed for replies.
Correct answer Dan Ebberts

You have a typo in your loop declaration. You have 1<=5 where it should be i<=5 .

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 7, 2023

You have a typo in your loop declaration. You have 1<=5 where it should be i<=5 .

Known Participant
March 7, 2023

Ooooo yes, I sure do! That solves that, thanks Dan