-
1. Re: Show or hide a symbol not an element in code
Graeme898 Nov 5, 2014 8:47 AM (in response to ywx012)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 :-)
-
2. Re: Show or hide a symbol not an element in code
Devendar_kumar Nov 5, 2014 8:56 AM (in response to ywx012)Hi,
Please check "Access a symbol timeline from the main stage" in the following document for helpful syntax and let me know if it helps.
Adobe Edge Animate CC JavaScript API
Regards,
Devendra
-
3. Re: Show or hide a symbol not an element in code
ywx012 Nov 5, 2014 8:58 AM (in response to Graeme898)Thank you for your answer, but it did not work
-
4. Re: Show or hide a symbol not an element in code
ywx012 Nov 5, 2014 9:14 AM (in response to ywx012)Devendar_Kumar
What I read in the document does not help because the line:
sym.getSymbol("kitten_1").$("kitten_paw").hide();
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
-
5. Re: Show or hide a symbol not an element in code
vivekuma Nov 5, 2014 9:24 AM (in response to ywx012)Try this
sym.getSymbol("someSymbol").getSymbolElement().hide();
hth,
Vivekuma
-
6. Re: Show or hide a symbol not an element in code
ywx012 Nov 5, 2014 9:32 AM (in response to vivekuma)Vivekuma,
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?
-
7. Re: Show or hide a symbol not an element in code
vivekuma Nov 5, 2014 9:43 AM (in response to ywx012)It should work in creationComplete as well, can you share your composition so that we can test it out.
-
8. Re: Show or hide a symbol not an element in code
ywx012 Nov 5, 2014 12:13 PM (in response to vivekuma)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.
-
9. Re: Show or hide a symbol not an element in code
resdesign Nov 5, 2014 12:37 PM (in response to ywx012)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.
-
10. Re: Show or hide a symbol not an element in code
ywx012 Nov 6, 2014 7:01 AM (in response to resdesign)resdesign,
Thank you, I'm going to explore that idea. Just a quick question. Is the name that appears in the elements panel the id?
-
11. Re: Show or hide a symbol not an element in code
ywx012 Nov 6, 2014 7:21 AM (in response to ywx012)Link to my file:
-
12. Re: Show or hide a symbol not an element in code
resdesign Nov 6, 2014 8:02 AM (in response to ywx012)Yes, the ID is the name in the elements panel.
Can you tell me what elements you would like to hide?
-
13. Re: Show or hide a symbol not an element in code
ywx012 Nov 6, 2014 12:22 PM (in response to resdesign)Thank you, resdesign, I found the solution to that problem. Thank you again.
-
14. Re: Show or hide a symbol not an element in code
resdesign Nov 6, 2014 12:23 PM (in response to ywx012)Oh, great! Good luck on your project.




