Get var name after loop

I have a loop that loads sprites from an array into a container. Which sprites get loaded depends on which button was clicked.

I need to change the individual sprite color when a user selects a color swatch.

I know the names of the sprite variables but I need a dynamic way to select them to be changed (since they were loaded dynamically).

For example my Container might have the following children:
headerv1
sidebarv1
footerv2.

the color change affects each element differently. ie.
header elements change to header color;
footer elements change to footer color, etc.

I need a more dynamic solution to change the color (because the header element might actually be headerv4.

root[“headerv1”].transform.colorTransform = headerColor;

Any help is appreciated!
Deborah