I’d like to remove a child of the display list if it exists before adding another to the stage. This gives me Error the first time I call it because ‘myMC’ doesn’t exist.
function callMc(){
if(myMc) removeChild(myMc);
myMc = new MyMc( newParams);
addChild(myMc);
}
Is there a better way of doing it?