 			}
 			catch (error:Error)
 			{
-				// do nothing
+				// Do nothing
 			}
 			return UIComponentClass != null;
 		}


		private function onMediatorCreate(event:MediatorFactoryEvent):void
		{
			const view:DisplayObject = event.view as DisplayObject;
			
			if(event.view && !view)
				initializeMediator(view, event.mediator);
			
			if (!view)
				return;

			view.addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);

			if (flexAvailable && (event.view is UIComponentClass) && !event.view['initialized'])
			{
				view.addEventListener('creationComplete', function(e:Event):void {
					view.removeEventListener('creationComplete', arguments.callee);
					// check that we haven't been removed in the meantime
					if (_factory.getMediator(event.view, event.mapping))
						initializeMediator(view, event.mediator);
				});
			}
			else
			{
				initializeMediator(view, event.mediator);
			}
		}

		private function onMediatorRemove(event:MediatorFactoryEvent):void
		{
			const view:DisplayObject = event.view as DisplayObject;

			if (view)
				view.removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
			
			if(event.mediator)
				destroyMediator(event.mediator);
			
			// note: as far as I know, the re-parenting issue does not exist with Flex 4+.
			// question: should we bother handling re-parenting?
			// Stray: let's not handle it. People can defend against unwanted hooks running
			// during reparenting for themselves quite easily.
		}

		private function onRemovedFromStage(event:Event):void

			_factory.removeMediators(event.target);
		}

		private function initializeMediator(view:Object, mediator:Object):void
		{
			if (mediator.hasOwnProperty('viewComponent'))
				mediator.viewComponent = view;
