DisplayObject getDisplayCache(int depth, int characterId){
DisplayObject displayObj = null;
List<DisplayObject> caches = _depth_displayCaches [depth];
if(caches!=null){
var enumerator = caches.GetEnumerator();
while (enumerator.MoveNext()) {
var cache = enumerator.Current;
if(cache.characterId == characterId)
{
caches.Remove(cache);
displayObj = cache;
break;
}
}
if(displayObj!=null){
// displayObj.view.removeFromParentAndCleanup(false);
displayObj.view.visible = true;
Movie movie = displayObj as Movie;
if(movie!=null){
//default to play or just show first frame?
// movie.GotoFrame(0);
movie.Play();
}
}
}
return displayObj;
}
void recycleDisplayCache(int depth, DisplayObject displayObj){