1 Reply Latest reply on Oct 31, 2012 9:52 AM by TimJaramillo

    hide a symbol from other symbol

    soniade Level 1

      Hi, i have several instances of symbol with an animation (ficha01, ficha02, ficha03, ficha04....) , and i need that when animation finish, parent symbol (for example ficha01) hide. How can i do?

       

      I try to pass a variable with the name of the symbol to hide, but I dont get access to a variable from last symbol.

       

      sym.setVariable("quepieza", 0);  // in stage script

       

      // in instance ficha01

      var seleccionada = sym.getVariable("quepieza");

      seleccionada = "akdjfkdljf";

      sym.setVariable("quepieza", seleccionada);

       

      // in  ficha01/tapa

       

      sym.getComposition().getStage().getSymbol("ficha01").$(seleccionada").hide();

       

       

      thanks!!

        • 1. Re: hide a symbol from other symbol
          TimJaramillo Level 4

          Hi soniade,

           

          I'm not quite sure how you're nesting your symbols, but you added a quote at end of seleccionada" that doesn't need to be there.

           

          You don't need to do any of the complicated variable setting. Just use sym.getComposition().getStage() to go up to stage, then use getSymbol() to get back down to your symbol.

           

          If you want to hide "ficha01" after the "ficha01" timeline finishes playing, you'd add this to the end of your "ficha01" timeline:

           

          sym.getComposition().getStage().$("ficha01"). hide();