# Timer problem

**URL:** <https://forum.kirupa.com/t/timer-problem/270153>\
**Category:** Uncategorized\
**Created:** [September 5, 2008, 5:36pm UTC](https://forum.kirupa.com/t/timer-problem/270153 "2008-09-05T17:36:14Z")\
**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 5, 2008, 5:36pm UTC](https://forum.kirupa.com/t/timer-problem/270153/1 "2008-09-05T17:36:14Z")

</div>

I have an object that i want to be removed 5 sec after it was created.

so i have

```php

var pwrTime:Timer = new Timer(5000);
//pwrTime.addEventListener(TimerEvent.TIMER, pwrTimer);

```

there is an object called pwr that gets created in another function so i added

```php

pwr.addEventListener(TimerEvent.TIMER, pwrTimer);
pwrTime.start();

```

and my pwrTimer function only has this

```php

function pwrTimer(evt:TimerEvent):void {
   container.removeChild(DisplayObject(evt.target));	
   pwrTime.stop();
}

```

when i run it the object is still there

anyone know why is the object not removed

tnx for any input

also, if i uncomment the commented line i get an error:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.utils::Timer@5280831 to flash.display.DisplayObject.
