2 Replies Latest reply on Sep 5, 2013 5:38 AM by juicy_life

    deleteSymbol question...

    juicy_life Level 1

      Assume we are trying to get rid of a dinamically created symbol when we click on it.


      What's the difference among these three lines of code?


      1. sym.deleteSymbol();
      2. sym.getSymbolElement().deleteSymbol();
      3. sym.getSymbolElement().remove();


      Do they all work? Do they do the same thing?

        • 1. Re: deleteSymbol question...
          AMULI Level 4

          Hi juicy_life,


          What is essential to grasp is that there are simultaneaously to hierarchies:


          1) a hierarchy of symbols nested into the stage symbol : statement 1 is relevant to that one ;


          2) a hierarchy of DOM elements : statement 3 is relevant to that latter, as is sym.getSymbolElement().hide();


          Statement 2 is false, confusing the two hierarchies.


          Reading the two articles by David Deraedt, Edge Animate for web developers (part 1 & 2), greatly helped me clarify this :




          Hope the same for you



          1 person found this helpful
          • 2. Re: deleteSymbol question...
            juicy_life Level 1

            Ok, so both 1) and 3) are correct but apply to Symbols or DOM elements respectively. However, deleteSymbol() applies to both hierarchies ( Symbols & DOM elements) getting rid of everything. I think that sym.getSymbolElement().remove() doesn't get rid of the symbol, just the DOM elements.


            Am I correct?