Whenever you are showing/hiding something, regardless of whether it is an element or symbol, it always uses the $ selector.
So instead of sym.getSymbol("someSymbol").hide();
try using sym.$("someSymbol").hide();
Hope that helps :-)
Thank you for your answer, but it did not work
What I read in the document does not help because the line:
references an element inside a symbol not a symbol. I want to hide the whole symbol with all its elements.
However I did try that line of code but for some reason it does not work on creationComplete but it does work on timeline triggers. It still leaves the question how do I hide a symbol? and why does that line not work on creationComplete
1 person found this helpful
Thank you for your answer. It works on the timeline triggers. I think I will use it. But I'm still puzzled as to why it won't work on creationComplete?
It should work in creationComplete as well, can you share your composition so that we can test it out.
I don't know how to share my composition. Maybe I can explain it.
I have a composition which displays a symbol that is created at runtime on the click of a button using the createChildSymbol() function. I want it to hide some nested symbols on its creationComplete event.
To share a composition , zip it, upload it to a cloud storage of your choice and share the link.
To hide element in a created symbol, you could give a class to these elements and then use it to hide these elements.
another way is to give an id to your created symbol and reach its element that way.
Let me know if you need an example.
Thank you, I'm going to explore that idea. Just a quick question. Is the name that appears in the elements panel the id?
Yes, the ID is the name in the elements panel.
Can you tell me what elements you would like to hide?
Thank you, resdesign, I found the solution to that problem. Thank you again.
Oh, great! Good luck on your project.