# Resize movieclips

**URL:** https://forum.kirupa.com/t/resize-movieclips/186313
**Category:** Uncategorized
**Created:** [April 20, 2006, 2:24pm UTC](https://forum.kirupa.com/t/resize-movieclips/186313 "2006-04-20T14:24:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)
#### Post date: [April 20, 2006, 2:24pm UTC](https://forum.kirupa.com/t/resize-movieclips/186313/1 "2006-04-20T14:24:32Z")

</div>

Hi,

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?

```php
var max_width = 124;
var max_height = 93;
var loader_listener:Object = new Object();
loader_listener.onLoadStart = function() {
    chan1_preview.setMask(chan1_mask);
    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;
};

```

---

<div class="post-metadata">

### Author: ![FizixMan](https://avatars.discourse-cdn.com/v4/letter/f/e9c0ed/32.png) [@FizixMan](https://forum.kirupa.com/u/FizixMan)
#### Post date: [April 20, 2006, 3:14pm UTC](https://forum.kirupa.com/t/resize-movieclips/186313/2 "2006-04-20T15:14:00Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)
#### Post date: [April 20, 2006, 4:21pm UTC](https://forum.kirupa.com/t/resize-movieclips/186313/3 "2006-04-20T16:21:07Z")

</div>

> [@FizixMan](#):
>
> 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

---

<div class="post-metadata">

### Author: ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)
#### Post date: [April 20, 2006, 5:10pm UTC](https://forum.kirupa.com/t/resize-movieclips/186313/4 "2006-04-20T17:10:21Z")

</div>

hi,

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.

g.
