# Trasnlate AS2 to AS3

**URL:** <https://forum.kirupa.com/t/trasnlate-as2-to-as3/254754>\
**Category:** flash\
**Created:** [March 14, 2008, 9:20pm UTC](https://forum.kirupa.com/t/trasnlate-as2-to-as3/254754 "2008-03-14T21:20:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fstekols\_gmail](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@fstekols\_gmail](https://forum.kirupa.com/u/fstekols_gmail)\
**Post date:** [March 14, 2008, 9:20pm UTC](https://forum.kirupa.com/t/trasnlate-as2-to-as3/254754/1 "2008-03-14T21:20:40Z")

</div>

Hey, i have this code:

copy = new Array("", “clicked button 1”, “clicked button 2”);

var btnNum = 2;

for (i=1; i\<=btnNum; i++) {  
this[“btn”+i].onRelease = function() {  
id = this.\_name;  
setStatus(id);  
};  
}

function setStatus(statement) {  
id = id.substr(3, 1);  
statusTxt.text = copy[id];  
}

it’s in AS2. How do i translate, or do the same thing, in AS3. And then use it to load in images dynamically that are in the array? So if someone can help me out that would be sweeeeet.
