4 Replies Latest reply on May 30, 2014 2:42 AM by joel_pau

    How to get Parent Symbol name of current e.target element ?

    cnachos

      How can I get the Parent Symbol name of the current e.target element ?

       

      would that involve using this ?

      getParentSymbol()

       

      Thanks for the help

        • 1. Re: How to get Parent Symbol name of current e.target element ?
          Sudeshnasarkar27 Adobe Employee

          Hi ,

           

          I created a composition where I am trying to access the parent symbol of a rectangle. The structure is like this -

           

          Stage->parentMainSymbol->ChildSymbol->childRectangle. Now for the parentMainSymbol click , to access the rectangle element(which is the target) you can use the following snippet -

          sym.getComposition().getStage().getSymbol("parentMainSymbol").getSymbol("ChildSymbol").$(" childRectangle")

          Now, the parent of this is ChildSymbol whose reference could be obtained by -

          sym.getComposition().getStage().getSymbol("parentMainSymbol").getSymbol("ChildSymbol").$(" childRectangle")[0].offsetParent

           

          The info about the parent symbol is just being printed in the console view for the attached composition. This would print it out for -

          #Stage_parentMainSymbol_childSymbol which is the parent symbol of the target childRectangle under consideration.

           

          Kindly, take a look and let me know if it solves your problem.

           

          Thanks and Regards,

          Sudeshna Sarkar

          1 person found this helpful
          • 2. Re: How to get Parent Symbol name of current e.target element ?
            cnachos Level 1

            Thanks for the reply but this is not what i'm looking for.

             

            I'm trying to find a way to get the PARENT SYMBOL NAME of any targeted element on the stage by using the e.target so that I don't need to specify any symbol name manually.

             

            Example:

             

            On stage, I have a symbol name "symContainer" and inside that symbol I have 3 elements called shape1, shape2, shape3. When i'm using EVENT like a Mouseover to apply a css properties change  using the e.target, it will change the properties of the target elements but I want to change the parent symbol properties only. I want a way to GetElementSymbolParent so that I can change properties of the parent symbol only.

             

            is there a e.target.parent or anything of that  sort ?

             

            Thanks

            • 3. Re: How to get Parent Symbol name of current e.target element ?
              Sudeshnasarkar27 Adobe Employee

              Hi ,

               

              I have created another sample which has a main parent symbol "symContainer" containing 3 shapes - Shape1 , Shape 2, Shape 3. The logic is written on mouseover of shape 2(which is the green rounded rectangle) and on mouseover it would return(in the console view print) - symContainer which is the parent symbol.

               

              console.log(sym.getSymbolElementNode().id);

               

              Hope this helps!

               

              Thanks and Regards,

              Sudeshna Sarkar

              1 person found this helpful
              • 4. Re: How to get Parent Symbol name of current e.target element ?
                joel_pau Level 5

                Hi,

                 

                You can also try: sym.getSymbolTypeName()

                ==> Here is a demo file: https://app.box.com/s/08kwggkuwnzfx61gwgad

                1 person found this helpful