A project I’m working on is working just fine at first, but as I perform more actions, it slows down noticeably. I’ve made sure to clear any onEnterFrame and setInterval events, so I don’t think the problem lies there. Most likely, it’s because practically every time an action occurs, much of the content on the screen is redrawn/recreated. However, every time I create a movie clip, text field, shapes, etc., I call a function to remove it beforehand:
function killThis(mc:MovieClip, thingsName:String):Void{
var obj:Object = mc[thingsName];
if (obj instanceof MovieClip){
obj.removeMovieClip();
}
else if (obj instanceof TextField){
obj.removeTextField();
}
}
killThis(_root, "calendarContainer");
_root.createEmptyMovieClip("calendarContainer", _root.getNextHighestDepth());
Any suggestions as to what I may be doing wrong?