I’m having trouble trying to work out how to centre 2 loaded images via XML. I found some code by scotty that will centre one image but of course when I’m loading 2 images, they are both stacked ont top of each other.
I think I know what I need to do but not sure how to transfer that into ActionScript. ie - I want to get the width of picture1 and picture2, put a bit of space in between and then centre them both on the stage.
Here is the code I have for that part (let me know if I need to post any other part of it). Can anyone help me amend what I’ve got to achieve what I need or do I need to do it a different way?
p = 0;
var cx = picture._x;
var cy = picture._y;
var dx = picture2._x;
var dy = picture2._y;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal() && picture2.getBytesTotal();
loaded = picture.getBytesLoaded() && picture2.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
if (picture2._alpha<100) {
picture2._alpha += 10;
}
if (ClientMC.client_txt._alpha<100) {
ClientMC.client_txt._alpha += 10;
}
if (DescMC.desc_txt._alpha<100) {
DescMC.desc_txt._alpha += 10;
}
}
picture._x = cx-picture._width/2;
picture._y = cy-picture._height/2;
picture2._x = dx-picture2._width/2;
picture2._y = dy-picture2._height/2;
};
Thanks