2 Replies Latest reply on Sep 1, 2013 9:10 AM by juicy_life

    getChildSymbols of one type only

    juicy_life Level 1

      Does anyone know if it's possible to get only some of the child symbols of a parent symbol. The getChildSymbols method doesn't take any argument like ("symbolTypeA") thus getting all child symbols without distinction. I found a way around this by "grouping" the each type of symbol into a newly created "sub-father" symbol owning symbol instances of one type only, and then, calling the getChildSymbols method inside "sub-father". But I don't like to create a symbol definition like "sub-father" which does nothing but just inlcuding another symbol definition.

       

      Let's say I have 3 types of symbols in the stage (A, B and C), and I create several symbol instances of each type dinamically using

      sym.createChildSymbol("symTypeA","Stage"), sym.createChildSymbol("symTypeB","Stage"), and sym.createChildSymbol("symTypeC","Stage"). Then I want to get just all symbols of type B, but if I use sym.getChildSymbols() I get all symbols of types A, B and C.

       

      I'm thinking about selecting the symbols I want by adding different class names to each type, but I'm not sure if this is the best way to do it.

        • 1. Re: getChildSymbols of one type only
          YOSHIOKA Ume Level 3

          Hi,  jusy_life.

           

          I think, you can use Composition.getSymbols(Symbol name).

          //get all of instances 'Symbol_A'
          var syms = sym.getComposition().getSymbols('Symbol_A');
          $.each(syms,function(){
            //stop the timeline of indivisual (access via 'this')
            this.stop();
          })
          

           

          HTH. Ume.

          1 person found this helpful
          • 2. Re: getChildSymbols of one type only
            juicy_life Level 1

            The problem with .getSymbols that only works at composition level, and it's not possible to scope it to a symbol.

             

            sym.getComposition().getSymbols("symTypeA") works fine returning all "symTypeA" instances in the composition, but...

            sym.getComposition().getStage().getSymbols("symTypeA") or sym.getComposition().getStage().getSymbol("containerSym").getSymbols("symTypeA") don't return anything at all.