Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Delete child symbol from stage

$
0
0

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. 

 

  1. call up “AR-percPass” (using the same code as above with a percPass in place of HistAims)
  2. 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

  1. sym.getParentSymbol().deleteSymbol();

 

Any advice would be appreciated.

 

Thanks

Randy


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>