Hi there, Is there a way to select a layer by just passing a variable name?Now sure if I'm clear but here is a sample of what I was thinking...
[currentItem.name].addButton.visible = false
Hi Erm, try targeting the children of currentItem like so... [currentItem].children.visible = false
If you have more than one child in your current item, you can iterate through the children like so, for all in arr[currentItem].childrenif all.name == "addButton"all.visible = false
Thanks so much, Malcolm! The second option worked great. :)
I did "for all in currentItem.children" what is the arr for?
Hi Erm, glad it worked for you. The arr is just a remnant from my test code. I had several items in an array called arr and I used a variable called currentItem = 1 to specify the index of the item I was targeting.
I see, thanks!