# Modify the duplicated object

**URL:** <https://forum.kirupa.com/t/modify-the-duplicated-object/310468>\
**Category:** Uncategorized\
**Created:** [June 10, 2010, 7:21pm UTC](https://forum.kirupa.com/t/modify-the-duplicated-object/310468 "2010-06-10T19:21:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackout188](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@blackout188](https://forum.kirupa.com/u/blackout188)\
**Post date:** [June 10, 2010, 7:21pm UTC](https://forum.kirupa.com/t/modify-the-duplicated-object/310468/1 "2010-06-10T19:21:30Z")

</div>

I am trying to duplicate the object and modify them with the following code  
but ac8 will not exist until the duplication is complete. Unfortunately the compiler doesn’t care that it will be created later, it just keep showing up the same error as always. Ac8 undefined. Will someone help me with this please and thank you.

if(myglobal.character==1){  
for (i=2;i\<8;i++){  
var ac:b1 = new b1();  
ac.x = (i-1)\*100;  
ac.y = 200;  
ac.name = “ac”+i;  
trace(ac.name)  
trace(ac.x);  
addChild(ac);  
}  
xTween=new Tween(ac8,“x”,Elastic.easeOut,60,200,.01,true);  
yTween=new Tween(ac8,“y”,Elastic.easeOut,120,180,.01,true);  
}
