6 Replies Latest reply on Apr 30, 2013 7:09 PM by TByrne.org

    Get symbol by Element


      Is there any way to get a reference to the Symbol object using a DOM element?

        • 1. Re: Get symbol by Element
          elainecc Adobe Employee

          Hi, TByrne.org-


          I'm unsure what you're asking.  Are you asking if you can refer to a symbol element as a DOM element, or make a DOM element a symbol?  Or are you asking something entirely different?





          • 2. Re: Get symbol by Element
            TByrne.org Level 1

            Unless I'm mistaken, each visual object in Edge has a Symbol instance and a DOM element.


            To get the DOM element a Symbol is associated with you use the getSymbolElement method (i.e. symbol.getSymbolElement())


            I am wondering if there is a way to do the reverse, something like:


            var symbol = AdobeEdge.getSymbolByElement(element);

            • 3. Re: Get symbol by Element
              elainecc Adobe Employee

              Ah, I see.  Right now, there isn't an API to do so.  I'm curious as to what use case you would have for this.  I can put it on our feature request list.





              • 4. Re: Get symbol by Element
                TByrne.org Level 1

                Well, I'm trying to overcome IEs lack of 'pointer-events' support by manually triggering mouse events via JQuery.


                Unfortunately, the Edge mouseover/mouseout/click actions don't seem to respond to events triggered in this way.


                This led me to look for a different workaround which would involve getting access to the appropriate Symbols from the DOM.


                We are in the early stages of building a vector-based game suite and unless we can get IE to play nicely we may have to drop Edge as our display/animation system.

                • 5. Re: Get symbol by Element
                  heathrowe Most Valuable Participant

                  What do you mean y 'pointer events' - can you clarify/specify.



                  • 6. Re: Get symbol by Element
                    TByrne.org Level 1

                    There is a CSS property called 'pointer-events' which allows you to specify which areas of an object are clickable.

                    This is particularly useful for vector based applications but doesn't work in IE (on objects other than SVG).


                    I've been looking at using the Document.elementFromPoint (along with display:none) to let clicks pass through certain objects, this all works until I get to triggering the click, which doesn't get recieved by the Edge trigger handlers.


                    I haven't looked into modifying edge to use svg elements instead of image/div elements, it seems like a longer shot but could result in better performance.