# Trying something with addEventListener

**URL:** <https://forum.kirupa.com/t/trying-something-with-addeventlistener/317495>\
**Category:** flash\
**Created:** [December 22, 2010, 4:01pm UTC](https://forum.kirupa.com/t/trying-something-with-addeventlistener/317495 "2010-12-22T16:01:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![itbkris](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@itbkris](https://forum.kirupa.com/u/itbkris)\
**Post date:** [December 22, 2010, 4:01pm UTC](https://forum.kirupa.com/t/trying-something-with-addeventlistener/317495/1 "2010-12-22T16:01:18Z")

</div>

I have been reading as3 documentation and the type of listener is supposedly a string value. So instead of creating a button the common way:

```auto
button1.addEventListener(MouseEvent.CLICK, clickaction);

```

I am trying to do it a different way:

```auto
var eventtype:String = "MouseEvent.CLICK";
button1.addEventListener(eventtype, clickaction);

```

I don’t get any errors when doing it this way but the MouseEvent.CLICK event is not added to the button. Any tried this before or have any thoughts?
