# "ENTER\_FRAME" vs "MOUSE\_OVER"

**URL:** <https://forum.kirupa.com/t/enter-frame-vs-mouse-over/270011>\
**Category:** flash\
**Created:** [September 4, 2008, 6:15am UTC](https://forum.kirupa.com/t/enter-frame-vs-mouse-over/270011 "2008-09-04T06:15:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![outlaw\_xXx](https://avatars.discourse-cdn.com/v4/letter/o/ecccb3/32.png) [@outlaw\_xXx](https://forum.kirupa.com/u/outlaw_xXx)\
**Post date:** [September 4, 2008, 6:15am UTC](https://forum.kirupa.com/t/enter-frame-vs-mouse-over/270011/1 "2008-09-04T06:15:09Z")

</div>

I am encountering an interesting error that someone hopefully can shed some light on.

I have an object that i want to remove from a Sprite once the y value reaches 0.

i made a Sprite and put one thing in it.

```php
var container:Sprite = new Sprite();
addChild(container);
var lB:Barrier = new Barrier();
container.addChild(lB);

```

I also added a mouse\_over listener and a enter\_frame listener.

now i have a different function that goes with the two listeners.  
in both of them i have a line for removing the lB clip.

```php
container.removeChild(DisplayObject(evt.target));

```

the line works just fine in the mouse\_over function.  
when the enter\_frame kicks in tho the clip gets removed also but then i get an error  
“The supplied DisplayObject must be a child of the caller” and the FPS go to about 1 lol

if anyone has any idea let me know …tnx all:beam::beam:
