# Help with a for statement in AS3/Flash9

**URL:** <https://forum.kirupa.com/t/help-with-a-for-statement-in-as3-flash9/224747>\
**Category:** flash\
**Created:** [May 5, 2007, 1:34am UTC](https://forum.kirupa.com/t/help-with-a-for-statement-in-as3-flash9/224747 "2007-05-05T01:34:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpeluso](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kpeluso](https://forum.kirupa.com/u/kpeluso)\
**Post date:** [May 5, 2007, 1:34am UTC](https://forum.kirupa.com/t/help-with-a-for-statement-in-as3-flash9/224747/1 "2007-05-05T01:34:10Z")

</div>

Ive been developing a project for a little over a month that I now need to convert to AS3 due to a qtvr “plugin” my client is insisting I use ([flashpanoramas.com](http://flashpanoramas.com)) which is AS3 only.

In AS2 i had the following code:

```auto

onEnterFrame = function () {
	for (i=1; i<=buttons.length; i++) {
		buttons*._x = (buttons[i-1]._x+buttons[i-1]._width);
		t*._x = (buttons[i-1]._x+buttons[i-1]._width+3); 
		}
};

buttons = new Array(square1, square2, square3, square4, square5, square6, square7, square8, square9);
t = new Array(t1, t2, t3, t4, t5, t6, t7, t8, t9);

function Animate(itemRelease) {
	for (i=0; i<=buttons.length; i++) {
		buttons*.tween('_y', 0,0.5,'easeOutQuad',0.55);
		t*.tween('_y', 0,0.25,undefined,0.75);
		buttons*.tween(xy, amountBack, time, ease, 0.5);
		}
	itemRelease.tween('_width', 360,0.5,'easeOutQuad',1);
	itemRelease.tween('_height', 360,0.5,'easeOutQuad',1);
	itemRelease.ySlideTo(-110, 0.5, "easeOutQuad",1);
	reset();
	itemRelease.enabled = false;
	itemRelease._y = -20;
	textNumber._y = -23;
	textNumber.alphaTo(0,0.25,"easeOutSine",0);
	}

```

I know that Ill need to rewrite Animate(), but my problem seems to be with my **for** statements. When I rewrote the onEnterFrame function to the code below I get this error:  
**TypeError: Error #1010: A term is undefined and has no properties.  
at total/onEnterFrame()**

```auto

var buttons:Array = new Array(square1, square2, square3, square4, square5, square6, square7, square8, square9);
var t:Array = new Array(t1, t2, t3, t4, t5, t6, t7, t8, t9);

addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void
{
	for (i=1; i<=buttons.length; i++) {
		buttons*.x = (buttons[i-1].x+buttons[i-1].width);
		t*.x = (buttons[i-1].x+buttons[i-1].width+3); 
              }
}

```

thanks in advance for any insight.
