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?
Do they all work? Do they do the same thing?
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
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?