# as3 to as2

**URL:** <https://forum.kirupa.com/t/as3-to-as2/309806>\
**Category:** Uncategorized\
**Created:** [May 25, 2010, 9:51am UTC](https://forum.kirupa.com/t/as3-to-as2/309806 "2010-05-25T09:51:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohya](https://avatars.discourse-cdn.com/v4/letter/o/fbc32d/32.png) [@ohya](https://forum.kirupa.com/u/ohya)\
**Post date:** [May 25, 2010, 9:51am UTC](https://forum.kirupa.com/t/as3-to-as2/309806/1 "2010-05-25T09:51:24Z")

</div>

Please convert the following to as2 for me:

import fl.controls.TextInput;  
import flash.event.\*;  
btn.addEventListener(MouseEvent.Click,delevt);

function delevt(e:MouseEvent)  
{trace(“done”);  
trace(bb.selectionBeginIndex);  
var n=bb.selectionBeginIndex;  
var s=bb.text.substr(0,n-1);  
var end=bb.text.substr(n,ss.length);  
trace(s+end);  
bb.text=s+end;}

Thanks beforehand.
