# How do I resize image loaded in a movie clip?

**URL:** https://forum.kirupa.com/t/how-do-i-resize-image-loaded-in-a-movie-clip/207463
**Category:** Uncategorized
**Created:** [November 17, 2006, 8:29pm UTC](https://forum.kirupa.com/t/how-do-i-resize-image-loaded-in-a-movie-clip/207463 "2006-11-17T20:29:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vde](https://avatars.discourse-cdn.com/v4/letter/v/f04885/32.png) [@vde](https://forum.kirupa.com/u/vde)
#### Post date: [November 17, 2006, 8:29pm UTC](https://forum.kirupa.com/t/how-do-i-resize-image-loaded-in-a-movie-clip/207463/1 "2006-11-17T20:29:47Z")

</div>

Hi All,

I’m facing to an annoying problem with flash, I’m trying to resize an image loaded in a movie clip, so that any image I load will always fit correctly in my movie.

The script is pretty simple, it reads an xml file where they should be 6 records. Loads the image in the Thumb attribute in on of the 6 containers eg. \_root.screen.Event1

```auto
 

  for (i=0; i < 6; i++){
   MyEvent = Event*.attributes ;
   _root.screen["Event"+i].Title.text = MyEvent.Title ;
   _root.screen["Event"+i].Date.text = MyEvent.Date ;
   _root.screen["Event"+i].Description.text = MyEvent.Description ;   
   loadMovie(MyEvent.Path+MyEvent.Thumb,_root.screen["Event"+i].Thumb);
   redim(100,100,_root.screen["Event"+i].Thumb);
   }

```

As you can see I try to resize the movie clip directly by using this function :

```auto

function redim(maxheight,maxwidth,clip){
 if (clip._height > maxheight) {
  ratio = clip._height / maxheight;
  clip._height = clip._height / ratio;
  clip._width = clip._width / ratio;
 }
 if (clip._width > maxwidth ) {
  ratio = clip._width / maxwidth;
  clip._height = clip._height / ratio;
  clip._width = clip._width / ratio;
 }
} 

```

It works but not as expected. It looks like only the container is scaled down not the image really.

How Can I achieve my goal ?

Regards,

Vde
