Modify the duplicated object

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);
}