4 Replies Latest reply on Jan 27, 2014 11:18 PM by claursen

    Changing sorting order for symbol/button.

    claursen Level 1

      I have a line of buttons (that are close to eachother). When clicked they scale up large.

       

      Problem is that the button clicked isn't arranged/sorted to the front and thereby is behind

      other buttons next to it.

       

      How do I change the sorting order (inside the button/symbol) when it is clicked?

        • 1. Re: Changing sorting order for symbol/button.
          Saurav Adobe Employee

          Hi Claursen,

           

          In the click event of the button you can add the following command :-

          I have asumed  that my symbol name is "btn1"

           

          var el = sym.getSymbol("btn1").getSymbolElement();

           

          el.css("z-index","1");

           

          By doing this the symbol will appear on top of other symbols . Hopw it helps

           

          Thanks

          Saurav

          1 person found this helpful
          • 2. Re: Changing sorting order for symbol/button.
            claursen Level 1

            Hi Saurav,

             

            Thanks for your reply! Very much appreciated.

             

            This was exactly what I was looking for. A line of code that could stack/sort the symbol.

             

            Unfortunately when I tried putting it in, it didn't work. Not sure what i'm doing wrong. I changed

            the btnl to my symbol name and tried both putting it in under mouseover and down.

             

            There's a lot of layers for this, dont know if that could be the issue. I tried changing the z index

            to 5. Still nothing. I have basically the stage, a symbol that covers most of the stage, inside that

            I have a symbol that holds all the buttons and inside that i have the buttons.

             

            Any idea what it might be?

            • 3. Re: Changing sorting order for symbol/button.
              Saurav Adobe Employee

              Hi Claursen,

               

              This is what I did to reproduce your scenario :-

               

              1.On stage I create a symbol , inside that I created another symbol and inside the nested symbol I created 3 symbols and named them "btn1" , "btn2" , "btn3".

               

              2.Now I opened the actions of symbol "btn1" and for click event I  wrote the following code

              var el = sym.getSymbol("btn1").getSymbolElement();

              el.css("transform","scale(4,4)");

              el.css("z-index","1");

               

              Similarly I put the code for click events for "btn2" and "btn3"

               

               

              3.Now When I published the file and clicked on any of the three symols , It scaled and was visible on top of the other symbols.

               

              Correct me if this is not the scenario you are facing .

               

              Thanks

              Saurav

              • 4. Re: Changing sorting order for symbol/button.
                claursen Level 1

                Yes, that worked. Thanks a lot!!!