[CS3 + AS2] Full browser MC resizing problem driving me crazy

Hi everyone,

I’ve implemented an XML-driven slideshow as a dynamic background to my Flash site. I haven’t tied the image transition to the main section buttons yet, because the problem I’m having right now is this. If you look at my mock-up at www.neueweb.com/test/idx.html the file will open up with my logo, nav and a beautifully blank grey background where the background images are supposed to be. Resize the browser a little bit, however, and all of the sudden the slideshow appears and transitions. The slideshow itself is in the root of the SWF, nested in a MC (although I’ve tried without nesting it, too, with the same result).

Here’s the code I’m using for resizing the MC/slideshow:


// ActionScript file for idx.fla/.swf
// Logo and navigation definitions are global throughout the site

/* Begin MovieClip list | format: (instance name) (description)

// logo | site logo (png, _root)
// frontMC | Front button (_root)
// profileMC | Profile button (_root)
// worksMC | Works button (_root)
// detailsMC | Details button (_root)
// bgPhotos | MC into which each section's background photo is loaded (_root)

/* End MovieClip list */

/* Begin stage resizing code */

// Stage paramaters
Stage.scaleMode = "noScale";
Stage.align = "TL";

// Logo positioning | stationary
logo._x = 40;
logo._y = 40;

// Resize function for container MovieClip
 var sListen:Object = new Object();
sListen.onResize = function():Void  {
    rePosition(bgPhotos);
};

// Resize function call
Stage.addListener(sListen);
function rePosition(bgPhotos:MovieClip):Void {
    if (Stage.width/Stage.height>bgPhotos._width/bgPhotos._height) {
        bgPhotos._width = Stage.width;
        bgPhotos._yscale = bgPhotos._xscale;
    } else {
        bgPhotos._height = Stage.height;
        bgPhotos._xscale = bgPhotos._yscale;
    }
}

rePosition(bgPhotos);

So what’s going on here? How come I’m seeing this behaviour? I’ve tried that code on static images nested in a MC, and it worked perfectly fine. I’ve also tried using the setSize(); method, and it doesn’t work at all.

Any help on this would be greatly appreciated, as I’d like to move on from this problem befor it makes me want to staple vital parts of my anatomy to my leg in despair …

Thanks in advance!

X.