# Coming from as3 event model

**URL:** <https://forum.kirupa.com/t/coming-from-as3-event-model/326065>\
**Category:** Uncategorized\
**Created:** [November 21, 2011, 1:16am UTC](https://forum.kirupa.com/t/coming-from-as3-event-model/326065 "2011-11-21T01:16:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlesg](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@charlesg](https://forum.kirupa.com/u/charlesg)\
**Post date:** [November 21, 2011, 1:16am UTC](https://forum.kirupa.com/t/coming-from-as3-event-model/326065/1 "2011-11-21T01:16:19Z")

</div>

Hi,

Trying to make a transition from as3 to as2 for a project… How can I replicate this as3 code in as2?:

for(var i:Number; i \< 5; i++)  
{  
var mc:MovieClip = new MovieClip();  
mc.name = “mc\_” + i;  
mc.addEventListener(MouseEvent.CLICK, handler);  
}

function handler(e:MouseEvent):void  
{  
trace(e.currentTarget.name);  
}

I know this isn’t functional, but you get the idea 🙂

Since the 2 languages seems alike except for the event model, any help would be appreciated.

Thanks
