External xml gallery + bg resize

Hi all,

I’m trying to load an external xml gallery using bg resize method but the gallery won’t load properly untill I resize myself the stage or I minimize/maximise while using a browser. The picture lags!! When I tested the xml structure alone it loads fine.
Does anyone know how to make this work??


Here’s my codes:

this is for “bgGradient_mc”

Stage.scaleMode = “noscale”;
Stage.align = “TL”;

var HorizPos = Math.round((Stage.width - bgGradient_mc._width) / 2);
var VertPos = Math.round((Stage.height - bgGradient_mc._height) / 2);

setProperty(bgGradient_mc, _width, Stage.width);
setProperty(bgGradient_mc, _height, Stage.height);

setMenuHorizontal();

var stageListener = new Object();
Stage.addListener(stageListener);

stageListener.onResize = function() {

setProperty(bgGradient_mc, _width, Stage.width);
setProperty(bgGradient_mc, _height, Stage.height);
setMenuHorizontal();

};

function setMenuHorizontal() {
var HorizPos = Math.round((Stage.width - bgGradient_mc._width) / 2);
var VertPos = Math.round((Stage.height - bgGradient_mc._height) / 2);
menuleftmc.menumc._alpha = 68;
menurightmc.menumc._alpha = 0;
setProperty(menuleftmc, _x, 0);
setProperty(menuleftmc, _y, 0);
setProperty(menuleftmc.menumc, _width, Stage.width);
//setProperty(menurightmc, _x, Stage.width - menurightmc._width); ou encore
setProperty(menurightmc, _x, (Stage.width + HorizPos) - menurightmc._width);
setProperty(menurightmc, _y, 0);
setProperty(copyrightmc, _x, Stage.width - 280);
setProperty(copyrightmc, _y, Stage.height - 30) ;
}

This is a submc of (bgGradient_mc) : “bgmc”

var monXML = new XML();
var chemin = “xml/”;

monXML.ignoreWhite = true;
monXML.onLoad = extraireGallery;
monXML.load(chemin+“bg_photos.xml”);

function extraireGallery(succes) {

var xmlNoeud = this.firstChild;
var tab_image = [];
var nb_total = xmlNoeud.childNodes.length;

if(succes) {
    for(i=0;i<nb_total;i++) {
        tab_image* = xmlNoeud.childNodes*.childNodes[0].firstChild.nodeValue;
    }
    bgmc.loadMovie(tab_image[0]);
} else {
    trace("File is found...");
}

}

and XML file structure:

<?xml version=“1.0” encoding=“iso-8859-1”?>
<background>
<landscape>
<images>http://www.kirupa.com/developer/mx2004/pg/kresge.jpg</images>
</landscape>
</background>