2 Replies Latest reply on Dec 21, 2015 7:05 AM by 1234jaime

    Could I hide a symbol with the name of a variable...?

    1234jaime

      I try to explain it ...

       

      All I want to do is assign a string( the name of the symbol) to a same variable in several symbols :

       

      var simbolo = "entrantes_sym";

      var simbolo ="postres_sym";

      ...

       

      And then hide this symbol with the new variable created :

       

      sym.getComposition().getStage().$(simbolo).hide();

       

      but don't work... help please!!!!!

        • 1. Re: Could I hide a symbol with the name of a variable...?
          joel_pau Level 5

          Hi,

           

          Your code is correct. I just check.

          Is the browser console empty?

           

          It can be:

          var simbolo = "aName";

          sym.getComposition().getStage().getSymbol(simbolo).getSymbolElement().hide();

          or

          sym.getComposition().getStage().$(simbolo).hide();

          • 2. Re: Could I hide a symbol with the name of a variable...?
            1234jaime Level 1

            Solved!!!!!!!! uuffffff...........

             

            I have several symbols on stage called :

             

            entrantes_sym

            postres_sym

            platos_sym

            ...

             

            and i declare  the same variable in all stage symbols :

             

            var simbolo = "postres_sym";

            sym.setVariable("simbolo", simbolo);

             

            var simbolo = "entrantes_sym";

            sym.setVariable("simbolo", simbolo);

             

            then inside of symbol called swipe_sym i put this code :

             

            var stage = sym.getParentSymbol();

            var sym2 = stage.getVariable("simbolo");

            sym.getComposition().getStage().$(sym2).hide();

             

            swipe_sym symbol is a child symbol of all the stage symbols.


            and the code works in all the symbols with only a few lines of code...


            Thanks.