Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Having trouble trying to control a series of elements using a for-loop

$
0
0

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?


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>