# \[F8\] loop problem

**URL:** <https://forum.kirupa.com/t/f8-loop-problem/172613>\
**Category:** flash\
**Created:** [December 16, 2005, 3:45am UTC](https://forum.kirupa.com/t/f8-loop-problem/172613 "2005-12-16T03:45:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dec27](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dec27](https://forum.kirupa.com/u/dec27)\
**Post date:** [December 16, 2005, 3:45am UTC](https://forum.kirupa.com/t/f8-loop-problem/172613/1 "2005-12-16T03:45:54Z")

</div>

This one works really fine, but… the first value is undefined…any idea…please? :crazy: :crazy:

Thanks!

var thumb\_spacing = 80;  
circlecenterX = Stage.width/2;  
circlecenterY = Stage.height/2;  
circleRadius = 250;  
drawRect = function (w, h) {  
this.beginFill(0x006699, 100);  
this.moveTo(0, 0);  
this.lineTo(0+w, 0);  
this.lineTo(0+w, 0+h);  
this.lineTo(0, 0+h);  
this.lineTo(0, 0);  
this.endFill();  
}  
function GeneratePortfolio(portfolio\_xml){  
var portfolioPictures = portfolio\_xml.firstChild.childNodes;  
for(var i=0; i\<portfolioPictures.length; i++){  
var currentPicture = portfolioPictures\*;  
var currentThumb\_mc=mc

noclips = portfolioPictures.length;  
var mc = this.createEmptyMovieClip(“mc5”+i, i);  
mc.\_x = circlecenterX+Math.sin(2_Math.PI_i/noclips)_circleRadius;  
mc.\_y = circlecenterY+Math.cos(2_Math.PI\*i/noclips)\*circleRadius;  
drawRect.apply(mc, [10, 10]);

currentThumb\_mc.title = currentPicture.attributes.title;  
currentThumb\_mc.image = currentPicture.attributes.image;  
currentThumb\_mc.thumb = currentPicture.attributes.thumb;

mc.onRollOver = mc.onDragOver = function(){  
info\_txt.text = this.title;  
thumb\_mc.loadMovie(this.thumb);  
}  
mc.onRollOut = mc.onDragOut = function(){  
info\_txt.text = “”;  
thumb\_mc.unloadMovie(this.thumb);  
}  
mc.onRelease = function(){  
image\_mc.loadMovie(this.image);

}  
}  
}

var portfolio\_xml = new XML();  
portfolio\_xml.ignoreWhite = true;  
portfolio\_xml.onLoad = function(success){

if (success) GeneratePortfolio(this);  
else trace (“error”);  
}  
portfolio\_xml.load(“estrellas.xml”)
