# For statement returns error when it is decreasing

**URL:** <https://forum.kirupa.com/t/for-statement-returns-error-when-it-is-decreasing/235617>\
**Category:** flash\
**Created:** [August 13, 2007, 2:19pm UTC](https://forum.kirupa.com/t/for-statement-returns-error-when-it-is-decreasing/235617 "2007-08-13T14:19:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superpeppe](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@superpeppe](https://forum.kirupa.com/u/superpeppe)\
**Post date:** [August 13, 2007, 2:19pm UTC](https://forum.kirupa.com/t/for-statement-returns-error-when-it-is-decreasing/235617/1 "2007-08-13T14:19:15Z")

</div>

Hi

Usually when you use the for statement you want the starting value to be 0, and the ending value to be larger than 0. But I need it to count down, so let’s say we have the following code:

```auto

package {
    import Array;
    import flash.display.Sprite;

    public class test extends Sprite {
        private var ARRAY:Array = [123, 456, 789]
        public function test ():void {
            for (var i:uint = ARRAY.length-1; i >= 0; i--) {
                ARRAY**=.5;
            }
        }
    }
}

```

It returns an error:TypeError: Error #1010: A term is undefined and has no properties.  
How should I then get it to count down?

Thanks in advance!
