Setting loaded swf dimension

hi guys…,

i’ll be straight to point,well i’m now working on a project using action script 3 now what i’m trying to make is a Main SWF that load whatever other swf into it the tricky thing is that i used 1 xml document read the external swf source nad it’s setting(such as it’s x,y position and it’s width and height) and i’m having problem setting it’s width and height (i mean the loaded swf width and height)


//variable list
var swfList:XMLList; //hold all the zone list from the xml
var totalZone:uint; //total of zone there is in the xml
var myURLLoader:URLLoader = new URLLoader();
var swf:Movie Clip;//hold the loaded swf
var swfLoader:Loader = new Loader();//loader instance used to load the external swf
var myCounter:uint = 0;

//load the xml file
myURLLoader.load(new URLRequest('myXMLFile.xml'));
myURLLoader.addEventListener(Event.COMPLETE, processXML, false, 0, true);

function processXML(e:Event):void
{
    removeEventListener(Event.COMPLETE, processXML);
    XML.ignoreWhitespace= true;
    var myXML:XML = new XML(e.target.data);
    swfList = myXML.SWF;
    totalSWF = myXML.SWF.length();
    
    loadSWF();
}

function loadSWF():void
{
    swfLoader.contentLoaderInfo.addEventListener(Event.INIT, swfSetting);
    swfLoader.load(new URLRequest(swfList[myCounter].@source));
}

function swfSetting(e:Event):void
{
    //making new instance of sprite to hold the new loaded swf
    swf = new MovieClip();
    //casting the loader content into a movieclip
    swf = e.target.content;
    addChild(swf);
    
    swfLoader.unload();
    
    swf.x = swfList[myCounter].@left;
    swf.y = swfList[myCounter].@top;
    swf.stageWidth = swfList[myCounter].@width;
    swf.stageHeight = swfList[myCounter].@height;
    
    addChild(swf);
    if(myCounter < totalSWF)
    {
        myCounter++;
        trace('myCounter: ' + myCounter );
        loadSWF();
    }
}

i do hope you guys can give me a solution cause it may be a small thing but it’s already make me going crazy…,
oh and btw i’m makin a desktop application…,
thanks guys…,