4 Replies Latest reply on Dec 11, 2012 12:23 PM by Dan G.

    Create Symbol=Lose Events

    Dan G. Level 2

      IE-Grouping elements into a symbol causes loss of events.

      Not sure if this is a bug but has anyone else noticed this?
      The workaround I've found is to to group the elements into a div, but then obviously...
      You can try yourself with the lynda tut / chapter 10 /Creating responsive layouts.

      http://www.lynda.com/Edge-Animate-tutorials/Edge-Animate-Essential-Training/108880-2.html

       

      I noticed this happening to me when Edge 1st introduced responsive layout, but I thought it was something I was doing wrong...

       

      In the example above the event is being lost on the element not grouped into a symbol.

       

      Message was edited by: GVD321

        • 1. Re: Create Symbol=Lose Events
          jbowden Adobe Employee

          Hi there,

           

          It's not clear to me what you're losing, and how it could possibly be related to using responsive layouts - if I have a responsive element with an event and convert it to a symbol, the element's event/code still exists.

           

          Please provide more information.

           

          Thanks,

          Joe

          • 2. Re: Create Symbol=Lose Events
            Dan G. Level 2

            Joe Bowden wrote:

             

            Hi there,

             

            It's not clear to me what you're losing, and how it could possibly be related to using responsive layouts

             

            Sure.
            Let me be more clear,

             

            In the following screencast we have a # of elements that are parts to a whole design (the chalkboard and the basket).

            I'm coverting them into symbols in order to facilitate responsive design.

             

             

            - if I have a responsive element with an event and convert it to a symbol, the element's event/code still exists.

             

             

             

            In the examples that follow, the red apple is the element not coverted into a symbol I spoke of above, that is "losing" it's mouseout and mouseover events when the other elements - that make up the chalkboard and the basket - are converted to symbols.

            The events trigger javascript/jQuery to dynamically change the text on the chalkboard, which has been coverted to a symbol via the Set Element Text snippet.

             

            In this screen cast the 1st version is with the elements that make up the chalkboard and the basket (Non responsive).

            The 2nd version is with those same elements converted to symbols (Responsive).

            Please feel free to correct me if I'm using the wrong terminology. A picture is worth a thousand blah blahs so here ya go.

            http://screencast.com/t/vmu3oiQ2f

             

            I hope this makes things clearer.
            Thanks.

            • 3. Re: Create Symbol=Lose Events
              jbowden Adobe Employee

              Hello again,

               

              Indeed this does make things clearer.

               

              What you're seeing isn't a bug in EA: no events got lost, and responsive layout is unrelated to what's happening.

               

              When you created symbols out of the elements (specifically, putting the Text element in a symbol), the code and events you had previously on the apple image are no longer going to work because that Text element is no longer at the same level as the apple - it's now inside a symbol. In other words, sym.$("Text").html("your text here") can't work because there is no longer a "Text" element there at the Stage level. So the bug, as it is, was in the code used.

               

              When you want to address an element within a symbol, use the getSymbol method to address the symbol, and then address the element within it. I believe your symbol wasn named "chalkboard"? So in that case, your code should be something like this:

               

              sym.getSymbol("chalkboard").$("Text").html("your text here");

               

              The EA Javascript API is your friend:

               

              http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html

               

              hth,

              Joe

              • 4. Re: Create Symbol=Lose Events
                Dan G. Level 2

                Joe Bowden wrote:

                 

                 

                 

                When you created symbols out of the elements (specifically, putting the Text element in a symbol), the code and events you had previously on the apple image are no longer going to work because that Text element is no longer at the same level as the apple - it's now inside a symbol. In other words, sym.$("Text").html("your text here") can't work because there is no longer a "Text" element there at the Stage level. So the bug, as it is, was in the code used.

                 

                When you want to address an element within a symbol, use the getSymbol method to address the symbol, and then address the element within it. I believe your symbol wasn named "chalkboard"? So in that case, your code should be something like this:

                 

                sym.getSymbol("chalkboard").$("Text").html("your text here");

                 

                The EA Javascript API is your friend:

                 

                http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html

                 

                hth,

                Joe

                 

                That's what I suspected. A 'targeting level' issue.
                I wasn't sure if there was some magic in the js that compesated for not targeting the Text within the symbol.

                Same rule applies. Got it.
                Obviously I'm not the greatest with code but I'm trying.
                The EA Api makes me nauseous.
                But I'm trying:-)

                 

                Edit

                 

                Altho someone might wanna notify the presenter in that Lynda tut because that fact is not mentioned.

                 

                Message was edited by: GVD321