1 person found this helpful
Hi Celine ,
Can you just try by listing all the child symbols using sym.getChildSymbols() and then deleting them using sym.deleteSymbol() . I assumed that you want to add different set of symbols at a different time on the timeline .
Another option is to set the symbol instance to an element container (draw out a rectangle element), instead of placing them on the Stage.
So, changes in bold
var myVar = Math.floor((Math.random()*6)+1);
// Set the child symbol container to an element; in my case a Rectangle element called Rectangle.
var stage = sym.$("Rectangle");
// Then before the symbol instance is created, call the empty() method on the previous container. In other
// words make sure it is empty before adding a random one.
var myAni = sym.createChildSymbol("Symbol_" + myVar, stage);
Both suggestions work! Thanks for solving the problem.