# Resize a random (loadMovie) load jpg (MX)

**URL:** <https://forum.kirupa.com/t/resize-a-random-loadmovie-load-jpg-mx/27162>\
**Category:** Uncategorized\
**Created:** [July 30, 2003, 6:41pm UTC](https://forum.kirupa.com/t/resize-a-random-loadmovie-load-jpg-mx/27162 "2003-07-30T18:41:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ogden](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@ogden](https://forum.kirupa.com/u/ogden)\
**Post date:** [July 30, 2003, 6:41pm UTC](https://forum.kirupa.com/t/resize-a-random-loadmovie-load-jpg-mx/27162/1 "2003-07-30T18:41:35Z")

</div>

i have 2 scripts that work fine on their own… but i can’t figure a way to combine them. any help would be great!

the first part resizes an 800x600 image to match the screen size:

bgHolder\_mc.\_width=Stage.width;  
bgHolder\_mc.\_height=Stage.width/4 \*3;

this works fine on its own if the image is on the stage.

the other pulls a random image and loads it into bgHolder\_mc:

backgrounds = new array (“background0.jpg”, “background1.jpg”, “background2.jpg”);  
function randomBackground () {  
randomNumber = random (backgrounds.length);  
loadMovie (backgrounds[randomNumber],"\_root.bgHolder\_mc");  
}  
randomBackground();

this works well on its own.

any idea how i can combine them?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 8:12pm UTC](https://forum.kirupa.com/t/resize-a-random-loadmovie-load-jpg-mx/27162/2 "2003-07-30T20:12:31Z")

</div>

what I do is load the movie in some movieclip (reminds self: use empty movieclip) and resize that movie. It works. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 8:22pm UTC](https://forum.kirupa.com/t/resize-a-random-loadmovie-load-jpg-mx/27162/3 "2003-07-30T20:22:53Z")

</div>

thanks.  
ended up doing it the other way around: scale if external swf and random in main swf. works like a charm!
