# Caller must be the parent

**URL:** <https://forum.kirupa.com/t/caller-must-be-the-parent/319335>\
**Category:** Uncategorized\
**Created:** [February 16, 2011, 9:24pm UTC](https://forum.kirupa.com/t/caller-must-be-the-parent/319335 "2011-02-16T21:24:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimacy](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rimacy](https://forum.kirupa.com/u/rimacy)\
**Post date:** [February 16, 2011, 9:24pm UTC](https://forum.kirupa.com/t/caller-must-be-the-parent/319335/1 "2011-02-16T21:24:16Z")

</div>

here is my set up :  
when health gets to 0 the view class sets it gameOver to true.  
the parent(named application) hears this and wants to remove the child view.

i get the error:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

here’s the application class

```auto

		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			addEventListener(Event.ENTER_FRAME,enterFrameHandler);
			
			addChild(_view);
			
		}
		
		private function enterFrameHandler(e:Event):void 
		{
			if(_view.gameOver==true)
			{
				trace("gameOverFromApplication");
				removeTheView();
			}
			_model.update();
			_view.keyPollUpdate();
		}
		private function gameOverHandler():void
		{
			trace("gameOverHandler");
		}
		private function removeTheView():void
		{
			this.removeChild(_view);
		}

```

i’m not understanding this
