Hi All,
I need help deleting a symbol from the stage. I have a list of symbols that are called to the stage at some point in a simulation. When the user leaves one symbol, it is supposed to delete itself and call up another (specific) symol. For example. I called the symbol “AR-HistAims” to the stage using
var mySymbolObject = sym.createChildSymbol("AR-HistAims", "Stage");
mySymbolObject.getSymbolElement().css({'position':'absolute','left': (mouseX - offset.left)/sx , 'top': (mouseY - offset.top)/sy});
mySymbolObject.play();
This works fine. I place an invisible button in the symbols timeline and when it is clicked I want it to do two things.
- call up “AR-percPass” (using the same code as above with a percPass in place of HistAims)
- remove “AR-HistAims” from the stage.
I can’t seem to get #2 to work. I’ve tried codes below and above the code for #1. When placed above, it deletes the current symbol, but doesn’t call up the new one. When placed below, the new symbol appears on top of the old one. The codes I've used are:
var childSymbols=sym.getComposition().getSymbols("AR-HistAims");
for(var i=0; i<childSymbols.length; i++)
childSymbols[i].deleteSymbol();
//and
var mySymbolObject = sym.getParentSymbol().getSymbol("mySymbol").getVariable("AR-HistAims");
stage.deleteSymbol();
//and
- sym.getParentSymbol().deleteSymbol();
Any advice would be appreciated.
Thanks
Randy