I have a case statement (from an earlier post - thank you) that works. I was wondering if it could be edited and change into a function instead. I think it would be cleaner. The variable is set in the Form Properties (pCounterA).
switch (pCounterA.value)
{
case "1":
profileA__1image.rawValue = profileA_1image.value.image.value;
pCounterA.value = "2";
break;
case "2":
profileA__1image.rawValue = profileA_2image.value.image.value;
pCounterA.value = "3";
break;
case "3":
profileA__1image.rawValue = profileA_3image.value.image.value;
pCounterA.value = "4";
break;
case "4":
profileA__1image.rawValue = profileA_4image.value.image.value;
pCounterA.value = "5";
break;
case "5":
profileA__1image.rawValue = profileA_5image.value.image.value;
pCounterA.value = "1"; // loops back to the first image
break;
}