# I am facing problem with EventDispatcher

**URL:** <https://forum.kirupa.com/t/i-am-facing-problem-with-eventdispatcher/322765>\
**Category:** flash\
**Created:** [June 2, 2011, 12:59pm UTC](https://forum.kirupa.com/t/i-am-facing-problem-with-eventdispatcher/322765 "2011-06-02T12:59:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milan\_vaja](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@Milan\_vaja](https://forum.kirupa.com/u/Milan_vaja)\
**Post date:** [June 2, 2011, 12:59pm UTC](https://forum.kirupa.com/t/i-am-facing-problem-with-eventdispatcher/322765/1 "2011-06-02T12:59:44Z")

</div>

Hello Every One i am trying to dispatch a custom event but i cant do that  
i cant understand what i am doing wrong

here is my code in test.as

package {

```
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.EventDispatcher;
import flash.events.Event;

public class test extends EventDispatcher {

	public function test() {
		trace("constructor");
		dispatchEvent(new Event("one second elapsed"));
    }
}

```

}

and here is my code in my action pannel

addEventListener(“one second elapsed”,onFun);

var test\_obj:test = new test();

function onFun(e:Event){  
trace(“event Dispatched”)  
}

i can trace construction But cant trace that “event Dispatched”

plz help me thnx in advance
