Is there a way to modify the code below to make the spacey = a variable + 15 so that the dynamically loaded images can vary in height and be spaced 15px apart? :red:
cliparray = [];
columns = 1;
spacex = 0;
spacey = 420;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
}
sload();
} else {
content = "file not loaded!";
}
}
this.createEmptyMovieClip("kk", 5029);
kk._x = 0;
kk._y = kk.starty=0;
btn.enabled = false
function drawSquare(clip, depth, colour, x, y, w, h) {
var mc = clip.createEmptyMovieClip("clip"+depth, depth);
mc._x = x;
mc._y = y;
mc.beginFill(0xcccccc);
mc.endFill();
return mc;
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("news.xml");
p = 0;
var ij = 0;
oarray = [];
function sload() {
for (var i = 0; i<image.length; i++) {
var clip = drawSquare(kk, i, 0, 0, 0, 575, 330);
clip._x = (i%columns)*spacex;
clip._y = Math.floor(i/columns)*spacey;
if (i%1 == 0) {
oarray.push(clip._y);
}
var clap = clip.createEmptyMovieClip("tt", 1);
clap._x = 0;
clap._y = 0;
cliparray.push(clap);
clip.pictureValue = i;
clip.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
}
startload();
}
this.createEmptyMovieClip("checker", 5000);
function checkload() {
checker.onEnterFrame = function() {
if (cliparray[ij]._width) {
delete this.onEnterFrame;
if (ij<cliparray.length-1) {
ij++;
startload();
}else{btn.enabled = true}
}
};
}
function startload() {
cliparray[ij].loadMovie(image[ij]);
checkload();
}