How to access element within symbol?


(Oana Goge) #1

I am trying to figure out how to make a group of elements that will repeat in multiple instances in the scene, and symbols seem great for this!

However, I need these groups to each display some text which I set through JavaScript.

Is there currently a way of getting a reference to an element from within a symbol instance?


(stephen) #2

I would recommend adding a class to the text element. Then looping through all of them and checking their parent symbol to see what text you should put in. You can get the parent symbol by using the following javascript: Getting the SymbolInstance for an element inside of a symbol.


(Oana Goge) #3

Great, thanks! This pretty much covers it.