# Looping and displaying different heights

**URL:** <https://forum.kirupa.com/t/looping-and-displaying-different-heights/231864>\
**Category:** Uncategorized\
**Created:** [July 9, 2007, 3:03am UTC](https://forum.kirupa.com/t/looping-and-displaying-different-heights/231864 "2007-07-09T03:03:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lula\_assassina](https://avatars.discourse-cdn.com/v4/letter/l/5f8ce5/32.png) [@lula\_assassina](https://forum.kirupa.com/u/lula_assassina)\
**Post date:** [July 9, 2007, 3:03am UTC](https://forum.kirupa.com/t/looping-and-displaying-different-heights/231864/1 "2007-07-09T03:03:07Z")

</div>

Hello, there!

So, I’m redesigning my website and it’s my first AS3 adventure.

The trick is: I’m calling variables from PHP and inserting data on text fields inside a mc. So far, do good.

My problem appears when I want to loop theese mc’s and displaying it’s instances with different heights.

My code goes below.

Cheers!

```auto
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.TEXT;
myLoader.load(new URLRequest("http://www.loligovulgaris.com/php/newsfeed.php"));
myLoader.addEventListener(Event.COMPLETE, makeVars);

var infomc:infoMc;
var infomcY:Number = 56;
var infomcH:Number = 0;

function makeVars(event:Event):void {
    var variables:URLVariables = new URLVariables(event.target.data);
    for (var i:Number = 0; i<variables.numberOfRows; i++) {
        infomc = new infoMc();
        addChild(infomc);
        infomc.textDate.text = "posted on "+variables["date"+i];
        infomc.textTitle.text = variables["title"+i];
        infomc.textBody.htmlText = variables["texto"+i];
        infomcY += infomcH+22;
        infomc.y = infomcY;
        infomcH = infomc.height;
    }
}

```
