i don't think there is a default way of doing it, but you could check what the parent is and use and if statement to handle it?
I'm assuming you're using AS3?
i.e in my child class if i do this trace(this.parent); it returns the name of my Document Class.