# Converting AS2 to AS3 help

**URL:** <https://forum.kirupa.com/t/converting-as2-to-as3-help/229580>\
**Category:** Uncategorized\
**Created:** [June 18, 2007, 7:36pm UTC](https://forum.kirupa.com/t/converting-as2-to-as3-help/229580 "2007-06-18T19:36:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kos4r](https://avatars.discourse-cdn.com/v4/letter/k/d2c977/32.png) [@kos4r](https://forum.kirupa.com/u/kos4r)\
**Post date:** [June 18, 2007, 7:36pm UTC](https://forum.kirupa.com/t/converting-as2-to-as3-help/229580/1 "2007-06-18T19:36:10Z")

</div>

I have AS2 code that looks like this

```auto
TextField.prototype.onKillFocus = function()

```

I want to convert this to AS3 code using an eventListener. I tried using

```auto
TextField.prototype.addEventListener(FocusEvent.FOCUS_IN, setProps);

```

but it doesnt work. Could someone please help me in figuring out how to make a generic function that can be used for multiple TextFields? Thanks
