# Resizing external swfs on load

**URL:** https://forum.kirupa.com/t/resizing-external-swfs-on-load/118396
**Category:** Uncategorized
**Created:** [August 5, 2004, 3:12am UTC](https://forum.kirupa.com/t/resizing-external-swfs-on-load/118396 "2004-08-05T03:12:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zerosignal0](https://avatars.discourse-cdn.com/v4/letter/z/8edcca/32.png) [@zerosignal0](https://forum.kirupa.com/u/zerosignal0)
#### Post date: [August 5, 2004, 3:12am UTC](https://forum.kirupa.com/t/resizing-external-swfs-on-load/118396/1 "2004-08-05T03:12:37Z")

</div>

Well Ive searched everywhere but havent found a answer to my question so here it goes. I have 3 swf videos that I made a few months ago and dont have the originals anymore so I can resize the files themselves so Im kinda having problems. I am making a random video playing banner and cant get my old swf files to resize to the dimensions I need them too…

heres the actionscript Im using so far…

```auto
 filename = ["escalade.swf", "1ce.swf", "lexani.swf"]; 
path = "c:/documents and settings/zerosignal/desktop/header template/"; 
i = filename.length; 
k = Math.floor(Math.random()*i); 
loadMovie(path+filename[k], load); 
 

```

note: path is just temporary

---

<div class="post-metadata">

### Author: ![Carixpig](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/carixpig/32/304_2.png) [@Carixpig](https://forum.kirupa.com/u/Carixpig)
#### Post date: [August 5, 2004, 4:26am UTC](https://forum.kirupa.com/t/resizing-external-swfs-on-load/118396/2 "2004-08-05T04:26:52Z")

</div>

By the look of your script, “load” is the mc where you are loading the banners. If this is correct, then all you have to do is scale the “load” mc. You could get the width and height properties of the loaded banner so that you know how much to scale the “load” mc.

---

<div class="post-metadata">

### Author: ![zerosignal0](https://avatars.discourse-cdn.com/v4/letter/z/8edcca/32.png) [@zerosignal0](https://forum.kirupa.com/u/zerosignal0)
#### Post date: [August 5, 2004, 7:08pm UTC](https://forum.kirupa.com/t/resizing-external-swfs-on-load/118396/3 "2004-08-05T19:08:38Z")

</div>

I dont think that can work… Heres the specs of what I have to do. My biggest swf that Im loading under the mask is w760 h 300. the rest of my swf files are smaller than that dimension wise but I want the smaller videos to still load into 760/300. I just cant seem to get this solved by myself Ive been trying all day. Anyones help would be greatly appriciated!

---

<div class="post-metadata">

### Author: ![Carixpig](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/carixpig/32/304_2.png) [@Carixpig](https://forum.kirupa.com/u/Carixpig)
#### Post date: [August 6, 2004, 1:35am UTC](https://forum.kirupa.com/t/resizing-external-swfs-on-load/118396/4 "2004-08-06T01:35:29Z")

</div>

It can work.

Let’s say you are loading your random movies into a movie clip called “load\_mc”. Load\_mc is a movie clip with a 760x300 rectangle, 0% alpha, no line. Put it on a layer and turn the layer to outlines so you can see where it is. This is just a tip for making your files easier to work with.

Make sure you have applied the instance name to load\_mc.

When you load the random movie clip, load\_mc will take on all the properties of the loaded clip, ie. it’s width and height. The following script might help:  
[AS]  
var ad\_number = 10; //this is the number of movies you have to choose from  
loadMovie(“banner” + random(ad\_number) + “.swf”, \_root.load\_mc);  
var ad\_width = \_root.load\_mc.\_width;  
var ad\_height = \_root.load\_mc.\_height;  
if(ad\_width != 760){  
\_root.load\_mc.\_width = 760;  
}  
if(ad\_height != 300){  
\_root.load\_mc.\_height = 300;  
}  
[/AS]  
This will resize your loaded clips but it night also squish them if they don’t have the 760:300 ratio.

If you don’t want them squished, play with this:  
[AS]  
var ad\_number = 10; //this is the number of movies you have to choose from  
loadMovie(“banner” + random(ad\_number) + “.swf”, \_root.load\_mc);  
var ad\_width = \_root.load\_mc.\_width;  
var ad\_height = \_root.load\_mc.\_height;  
if(ad\_width \< 760){  
\_root.load\_mc.\_width = 760;  
\_root.load\_mc.\_xscale = \_root.load\_mc.\_yscale;  
}else if(ad\_height \< 300){  
\_root.load\_mc.\_height = 300;  
\_root.load\_mc.\_xscale = \_root.load\_mc.\_yscale;  
}  
[/AS]  
No guarantees as I’m just making it up, but I think it should work.
