I apologise for posting on a topic that I’ve seen before; however the other threads don’t help me fully.
I can only get the first image to be the one that is centred, subsequent images all position themselves to the top left of the first image
again I apologise for the long code.
```php
Stage.scaleMode = "noScale";
Stage.align = "TL";
var newMenu = new ContextMenu();
this.menu = newMenu;
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++)
{
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
} // end of for
trace (thumbnails);
firstImage();
delay = setInterval(makeButtons, 50);
}
else
{
content = "file not loaded!";
} // end else if
} // End of the function
function nextImage()
{
if (p < total - 1)
{
++p;
if (loaded == filesize)
{
picture._alpha = 100;
picture.loadMovie(image[p], 1);
if (description[p] == undefined)
{
desc_txt.htmlText = " ";
}
else
{
desc_txt.htmlText = description[p];
} // end else if
picture_num();
} // end if
} // end if
} // End of the function
function prevImage()
{
if (p > 0)
{
--p;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
if (description[p] == undefined)
{
desc_txt.htmlText = " ";
}
else
{
desc_txt.htmlText = description[p];
} // end else if
picture_num();
} // end if
} // End of the function
function firstImage()
{///first picture
if (loaded == filesize)
{
picture._alpha = 50;
picture.loadMovie(image[0], 1);
if (description[0] == undefined)
{
desc_txt.htmlText = " ";
}
else
{
desc_txt.htmlText = description[0];
} // end else if
picture_num();
} // end if
} // End of the function
function picture_num()
{
current_pos = p + 1;
pos_txt.text = current_pos + " / " + total;
} // End of the function
function makeButtons()
{
tnNr = 0;
clearInterval(delay);
trace (tArray.length);
for (var _loc2 = 0; _loc2 < thumbnails.length; ++_loc2)
{
var _loc3 = scroll.th_nav.thmb.duplicateMovieClip("thmb" + _loc2, 1000 + _loc2);
_loc3.id = _loc2;
_loc3._x = _loc2 * 60;
_loc3.pictureValue = _loc2;
_loc3.onRelease = function ()
{
p = this.pictureValue - 1;
nextImage();
trace ("clicked");
};
_loc3.onRollOver = function ()
{
this._alpha = 40;
};
_loc3.onRollOut = function ()
{
this._alpha = 100;
};
} // end of for
loadButtons();
_level0.scroll.setRollOver();
} // End of the function
function loadButtons()
{
var tbox = scroll.th_nav["thmb" + tnNr].box;
tbox.loadMovie(image[tnNr]);
temp = this.createEmptyMovieClip("tmp" + tnNr, 999);
temp.onEnterFrame = function ()
{
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
btotal = bl / bt * 100;
trace (btotal);
bar = scroll.th_nav["thmb" + tnNr].thumbBar;
if (bl == bt && bt > 4 && bar._width == 100)
{
nextButton();
delete this.onEnterFrame;
tbox._width = tbox._width * 2.000000E-001;
tbox._height = tbox._height * 2.000000E-001;
bar._visible = 0;
}
else
{
bar._width = btotal;
if (!isNaN(btotal))
{
scroll.th_nav["thmb" + tnNr].per.text = btotal + "%";
} // end if
} // end else if
};
} // End of the function
function nextButton()
{
if (tnNr < thumbnails.length - 1)
{
++tnNr;
loadButtons();
} // end if
} // End of the function
desc_txt.autoSize = true;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (myid === undefined)
{
myid = 4148;
} // end if
if (prev == "1")
{
xmlData.load("images.xml");
}
else
{
xmlData.load("images.xml");
} // end else if
listen = new Object();
listen.onKeyDown = function ()
{
if (Key.getCode() == 37)
{
prevImage();
}
else if (Key.getCode() == 39)
{
nextImage();
} // end else if
};
Key.addListener(listen);
previous_btn.onRelease = function ()
{
prevImage();
};
next_btn.onRelease = function ()
{
nextImage();
scroll.thumbnail_mc.easeX(Math.round(scroll.thumbnail_mc._x / scroll.thumbnail_mc.thmb.tmb._width - scroll.thumbnail_mc["thmb" + d]._x + 4));
};
p = 0;
bottomcontainer = picture2;
this.onEnterFrame = function ()
{
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
percent = 100 * loaded / filesize;
preloader._visible = true;
preloader.mask1.maske._rotation = 0;
preloader.mask2.maske._rotation = 0;
if (loaded != filesize)
{
if (percent <= 50)
{
preloader.mask1.maske._rotation = -3.600000E+000 * percent;
}
else
{
preloader.mask1.maske._rotation = -180;
preloader.mask2.maske._rotation = -3.600000E+000 * (percent - 50);
} // end else if
}
else
{
preloader._visible = false;
picture._x = mask._x - picture._width / 2;
picture._y = mask._y - picture._height / 2;
var _loc1 = mask._width + 80;
var _loc2 = mask._height + 80;
var _loc3 = picture._width ;
var _loc4 = picture._height;
if (picture._alpha < 100)
{
picture._alpha = picture._alpha + 10;
} // end if
} // end else if
};
Many thanks!
Matt