Resize movieclips


i am trying to resize externally loaded swf`s that are 800x600 to fit in a preview window that is 124x93… everything works great as long as the external swfs have a MC that fills the stage (i.e that is 800x600) is there a way to get around this?

var max_width = 124;
var max_height = 93;
var loader_listener:Object = new Object();
loader_listener.onLoadStart = function() {
    chan1_preview._visible = false;
loader_listener.onLoadInit = function(target_mc:MovieClip):Void  {
    var chan1_preview_x = 263;
    var chan1_preview_y = 231;
    // resize to fit width 
    target_mc._width = max_width;
    target_mc._yscale = target_mc._xscale;
    // if height is too much then resize to fit height
    if (target_mc._height>max_height) {
        target_mc._height = max_height;
        target_mc._xscale = target_mc._yscale;
    // center clip (rounded to nearest pixel to keep things sharp)                  
    chan1_preview._x = Math.round(chan1_preview_x+(max_width-target_mc._width)/2);
    chan1_preview._y = Math.round(chan1_preview_y+(max_height-target_mc._height)/2);
loader_listener.onLoadComplete = function() {
    chan1_preview._visible = true;

Maybe I’m wrong on this. But I thought the _height/_width properties are uneditble variables. They’re just properties of the object that you can’t change (sort of like _xmouse). You can only resize them with _xscale/_yscale.

No. _height and _width of a MC can both be edited.

As for an answer to the OP’s question; Can you post a FLA? I’m not sure I understand your problem


basically i want to load lots of external swfs which are all 800x600 expect some of these dont have content that fills the entire stage. these swf simple do not load, unless i fill the stage with an empty movieclip. i want all the clips to keep the 800x600 ratio.