Hi,
I’m currently working on a site where the background pictures (wallpapers) loads randomly with xlm.
Loading of the pictures working properly until I try to put the AS: (stageResize/stageListener) it doesn’t load.
I have tried numerous things but it’s still not working.
I’ve used the following script:
Stage.scaleMode = "noScale";
Stage.align = "TL";
stageResize = function () {
background_mc._x = 0;
background_mc._y = 0;
background_mc._width = Stage.width;
background_mc._height = Stage.height;
maskbg_mc._y = Stage.height / 2 - maskbg_mc._height / 2;
maskbg_mc._x = Stage.width / 2 - maskbg_mc._width / 2;
};
stageResize();
var stageListener:Object = new Object();
stageListener.onResize = function() {
stageResize();
};
Stage.addListener(stageListener);
var bgxml = new XML();
bgxml.ignoreWhite = true;
bgxml.load("xml/backgrounds.xml");
bgxml.onLoad = function (success)
{
back = bgxml.firstChild.childNodes.length;
i = Math.floor(Math.random() * back);
background_mc.loadMovie(this.firstChild.childNodes*.childNodes[0].attributes.pica);
};
Does anybody have a clue how I can solve this problem?
I also include the FLA.
Thanks,
Marvin