partAdded() and partRemoved() are great additions to the Spark architecture, allowing deferred assignment of event listeners to skin parts until they are actually needed. It's clear enough that partAdded() gets called when a skin part is instantiated. Is partRemoved() then called when the part is removed from the display list, or only when the part is made eligible for garbage collection? That seems to be the case, but I'd love to have it officially confirmed or corrected.
For exampe, if a skin part is part of stateOne but not part of stateTwo, does the skin part have to be destroyed (itemDestructionPolicy="auto") in order for partRemoved() to be called for that part? If so, what is the recommended approach for handling addition to and removal from the stage -- addding ADDED_TO_STAGE and REMOVED_FROM_STAGE event handlers during partAdded() execution? That seems a little wonky, but I've not found a better approach.
This is an excellent question that I'd like to see answered as well...
Adobe's VideoPlayer component uses partRemoved to cleanup and stop video playback. I'm trying to do the same with my own video player, and partRemoved is never called. I have to use a complicated removedFromStage technique that uses booleans to check to see if this is caused by a fullscreen event.
You can look in SkinnableComponent.as. Whenever the skin changes or parts
are removed by state changes, you should get a partRemoved.