trying to loop out some pictures using a for loop and cant get them to be posiotioned directly beneath the previous picture, I have set the height number in my xml where I get the pictures from.
heres my actionscript code for the loop:
private function loadImage():void{
for(var i:int = 0;i<_items.length;i++){
_image = new LoadExternaly(_items[i].getImage(), _items[i].getText(), _items[i].getTitle(), _items[i].getHeight());
_images.push(_image);
var prevItem:int = i;
if(prevItem>0) {
prevItem--;
}
_images[i].y = 0+(_images[prevItem].y+ _images[prevItem].getHeight());
addChild(_image);
}
}
Edit: This is how the code should look like if you are trying to place pictures directly beneath the previously added picture using a class with parameters, in this case the "LoadExternaly" is that class.