# Iteration statement "for each..in" as part of a constructor?

**URL:** <https://forum.kirupa.com/t/iteration-statement-for-each-in-as-part-of-a-constructor/317496>\
**Category:** flash\
**Created:** [December 22, 2010, 4:44pm UTC](https://forum.kirupa.com/t/iteration-statement-for-each-in-as-part-of-a-constructor/317496 "2010-12-22T16:44:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenBart](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@BenBart](https://forum.kirupa.com/u/BenBart)\
**Post date:** [December 22, 2010, 4:44pm UTC](https://forum.kirupa.com/t/iteration-statement-for-each-in-as-part-of-a-constructor/317496/1 "2010-12-22T16:44:49Z")

</div>

I was just thinking… is there a way to look at each variable passed into the paramaters of a function. For example, taken the given code.

```auto

package 
{
    import flash.display.MovieClip;
    import flash.display.Shape;
        
    public class Dot extends MovieClip
    {
        color:uint;
        dotSize:uint;
        doughnutSize:uint;
        doughnutHoleSize:uint;
        
        public function Dot(color:uint = 0xF15C25, dotSize:uint = 5, doughnutSize:uint = 30, doughnutHoleSize:uint = 40)
        {
            this.color = color;
            this.dotSize = dotSize;
            this.doughnutSize = doughnutSize;
            this.doughnutHoleSize = doughnutHoleSize;
        }

    }

}

```

So in this instance it would loop through color, dotSize, doughnutSize, and doughnutHoleSize and set the paramaters of the class to be the same value.

Example for each loop:

```auto
for (var key:String in object){
	trace(key + ": " + object[key]); // object[key] is value
}

```

So, is this possible?
