Coordinate origin screwed up?

Hi! I’m building a Flash preloader that I want to give away so anyone can use it to load any sized SWF. It’s just an all-actionscript animation that shows in the center.

The problem I’m having occurs when the movie dimensions given in the HTML do not match those of the preloader’s published SWF. In my test case, the movie was exported at 400x400. I’m testing it in an HTML page at 829x397, since the SWF to be loaded is that size. What happens is the preloader at x=0 seems to actually be some 220+px from the left side of the flash area! (this distance seems to be half the difference between exported and HTML dimensions, as though it’s attempting to center content) This affects both the preloader animation (offset far right of center) as well as the loaded SWF, which appears with it’s left edge not at 0px where it’s supposed to be but at the same 220+px point that seems to be the new ‘origin’.

So, stage.x = stage.y = 0, so I can’t tell anything from that. localToGlobal returns 0 as well. stage.stageWidth and stage.stageHeight are consistent with the dimensions given in the HTML. So it seems to be silently shifting the whole coordinate system when the display dimensions don’t match the exported dimensions? The animation code happens within a class specified as the Document class, so it’s the root object. The loaded SWF, when it arrives, is placed as a child of this object.

Help much appreciated by this n00b!