I have a number of elements in my composition, which I would like to control via a for-loop. Let's say I have 5 elements, named "Element1," "Element2"..."Element5." I have created an array that stores the element names:
elementArray = ["Element1","Element2,"Element3","Element4","Element5"]
Now, I would like to hide all these elements using a for-loop:
for (var i=0; i<elementArray.length; i++) {
elementArray[i].hide();
}
However, when I run this code I get an error, "Javascript error in event handler! Event Type = element"
I'm pretty sure I'm not understanding something to do with namespace or scope here - can anyone help me with this?