Within your listener function include another function which loops through all swf panels in the IDE, checking if the name of your panel exists. If it doesn't then remove your listener and return out of your listener function.
function myListenerFunction () {
if ( !checkForPanel( myPanelName ) ) {
fl.removeEventListener( type, eventID );
return;
}
}
function checkForPanel( arg_panelName ) {
var target_panelName = arg_panelName;
var target_panelsArr = fl.swfPanels;
var i;
var iLen = target_panelsArr.length;
var _swfPanel;
for ( i = 0; i < iLen; i++ ) {
_swfPanel = target_panelsArr[i];
if ( (_swfPanel.name) == target_panelName ) {
return true;
}
}
return false;
}