Load external swf as full browser scaleable flash

Hi Again,

Take a look at this swf file. Click on the gray bar, and an external swf should load, replaces the rolling ball. I would like this external swf, called ‘circles’ to load into the blank movie clip ‘blankmc’. I would like the external swf contained within the blankmc movie clip to be full browser flash and scaleable with any change in browser size. Currently it relocates itself upon resize to the lower right corner, with the top corner of the external swf situating itself on the center of the blank mc.


import flash.display.MovieClip;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.MouseEvent;
stage.align = "TL";
stage.scaleMode = "noScale";

var Xpos:Number = 0;
var Ypos:Number = 0;
var swf:MovieClip;
var loader:Loader = new Loader();

// this is the default swf //
var defaultSWF:URLRequest = new URLRequest("default.swf");

loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
blankmc.addChildAt(loader, 0); // adds loader as child to display list

// btns universal function
// loads any swf whose file name matches the instance name of the buttons

function btnClick(event:MouseEvent):void{
    blankmc.removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest(event.target.name + ".swf")
    loader.load(newSWFRequest);
    loader.x = Xpos;
    loader.y = Ypos;
    blankmc.addChildAt(loader, 0);
}
//btn listeners
circles.addEventListener(MouseEvent.CLICK, btnClick); //runs universal btn function evertime sample btn is clicked.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//define dynamic aspect ratios

var blankmcHeight = blankmc.height / blankmc.width;
var blankmcWidth = blankmc.width / blankmc.height;

//add event listener to the stage
stage.addEventListener(Event.RESIZE, sizeListener);

//conditional statement to account for various initial browswer sizes and proportions
function scaleProportional():void {
    if ((stage.stageHeight / stage.stageWidth) < blankmcHeight) {
        blankmc.width = stage.stageWidth;
        blankmc.height = blankmcHeight * blankmc.width;
    } else {
        blankmc.height = stage.stageHeight;
        blankmc.width = blankmcWidth * blankmc.height;
    };    
}

//center slideshowture on stage
function centerslideshow():void {
    blankmc.x = stage.stageWidth / 2;
    blankmc.y = stage.stageHeight / 2;
}

// make listener change slideshowture size and center slideshowture on browser resize
function sizeListener(e:Event):void {
    scaleProportional();
    centerslideshow();
}

I’m aware that for the full browser flash you need to set width and height to 100% on publish settings, but that isn’t exactly what I’d like (get’s stretchy… i’d like to do with with code).