You're pretty close. The show() command requires the jQuery handle, so you should use:
Hope that helps!
Thanks a lot, that did the trick !
But how is it possible to know when to use $("") or getSymbol("") ? getCompostion().getStage() or getParent() ?
I'm getting quite lost !
1 person found this helpful
Think of symbols as independent timelines that can contain other elements, or instances of other symbols. The Stage/main timeline is a symbol as well. Scripting calls are scoped to the symbol that the script is in. The keyword sym stands for the symbol that you're in with the script.
So if your script is at the same level as what you are targeting with it:
- Use sym.$("elementName") to access an element's properties
- Use sym.getSymbol("symbolName") to access a symbol's timeline. If there's another symbol inside that symbol that you want to access, you'd use sym.getSymbol("symbolName").getSymbol("childSymbolName")...that's only two levels deep, but you can go as deep as needs be.
- If you're trying to access an element in a symbol, you'd combine these two, such as sym.getSymbol("symbolName").$("elementName")
When your script is within a symbol and you want to access an element or symbol outside of the symbol timeline:
- Use sym.getParent() to get to any elements that are in the parent symbol (the symbol which contains the symbol you're calling from), which could be the Stage or could be another parent symbol
- Use sym.getComposition().getStage() from any symbol level to access things at the main Stage level. You can also dive into a symbol on the Stage from any symbol using sym.getComposition().getStage().getSymbol("symbolName").
All is explained in detail here:
Thanks, I had seen the API document earlier but your explanation makes it clearer !