 
         /**
 		 * Disposes the mediator on removal from the facade. Subclasses
-		 * that override this should call super.dispose. 
+		 * that override this should call super.dispose.
 		 */
 		override public function onRemove():void {
 
             var component:UIComponent = viewComponent as UIComponent;
             if( component ) {
 
-                component.removeEventListener( StateChangeEvent.CURRENT_STATE_CHANGE, onViewComponentStateChangeListener );
+                component.removeEventListener( StateChangeEvent.CURRENT_STATE_CHANGE, stateChangeListener );
             }
 			dispose();
 		}
-		
+
 		/**
 		 * Hook method to listen for a specific mediator registration. Subclasses
-		 * can use this method to react to mediator registration as needed. 
+		 * can use this method to react to mediator registration as needed.
 		 */
 		protected function registrationCompletedListener(event:MediatorRegistrarEvent):void {
 			//var registrar:MediatorRegistrar = event.target as MediatorRegistrar;
 			//trace("AutoRegistration completed for mediator " + event.mediator.getMediatorName());
 			//trace("\tviewComponent = " + event.mediator.getViewComponent());
 		}
-		
+
 		/**
 		 * Hook method to listen for a specific mediator registration cancellation.
 		 * Subclasses can use this method to react to mediator cancellation as needed.

		public function clone():ICloneable {
			var classpath:String = getQualifiedClassName(this);
			classpath.replace("::", ".");
			
			var clazz:Class = fabrication.getClassByName(classpath);
			var clazzInfo:XML = describeType(clazz);
			var constructorNode:XMLList = clazzInfo..constructor as XMLList; 
			var requiredParameters:XMLList = constructorNode.parameter.(@optional = "false"); 
			var requiredParametersCount:int = requiredParameters.length();
			var mediator:FlexMediator = CloneUtils.newInstance(clazz, requiredParametersCount) as FlexMediator;

			mediator.setMediatorName(getMediatorName());
			mediator.setViewComponent(getViewComponent());
			
			requiredParameters = null;
			constructorNode = null;
			clazzInfo = null;
			clazz = null;
			
			return mediator;
		}

		/**
		 * Changes the mediator name. This is done when RegExp 
		 * component resolvers are used.
		 * 
		 * @param name The name of the mediator
		 */
		fabrication_internal function setMediatorName(name:String):void {
			this.mediatorName = name;
		}
		
		/**
		 * Creates the base link of the component resolver chain. Additional
		 * link can be added to this to indicate the path to your viewComponent.

 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.puremvc.as3.multicore.utilities.fabrication.patterns.mediator {
    import mx.events.StateChangeEvent;

