if imgLoader
is the gallery that you want deleted then this should help:
if (objectParent.getChildByName("imgLoader") != null) {
trace("imgLoader exsits");
objectParent.removeChild("imgLoader");
}
Basically this is checking if imgLoader
exist and if it does, it removes it.