# Scale image inside MovieClip

**URL:** <https://forum.kirupa.com/t/scale-image-inside-movieclip/215554>\
**Category:** flash\
**Created:** [February 8, 2007, 5:22am UTC](https://forum.kirupa.com/t/scale-image-inside-movieclip/215554 "2007-02-08T05:22:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wisene](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@wisene](https://forum.kirupa.com/u/wisene)\
**Post date:** [February 8, 2007, 5:22am UTC](https://forum.kirupa.com/t/scale-image-inside-movieclip/215554/1 "2007-02-08T05:22:55Z")

</div>

Hi all, i cant figure how to scale the image which is inside the movieclip…

I got a button when clicked create a dynamic movieclip then loads the image inside, unfortunately if the image is bigger then movieclip, then movieclip automatically resizes itself. What i m trying to achieve is, if the movieclip is 200x300px n the image is bigger then that. Image shld resize itself n stay center aligned to the movieclip… is that possible???

my code:

```auto
on (click) { 
import flash.net.FileReference; 
import flash.display.BitmapData; 

var listener:Object = new Object(); 
listener.onSelect = function(file:FileReference):Void { 
//trace("name: " + file.name); 

var mcPict:MovieClip = createEmptyMovieClip( 'mcPict', 9000 ); 
//mcPict._x = 20; 
//mcPict._y = 20; 
mcPict._xscale = 20; 
mcPict._yscale = 20; 
mcPict.loadMovie( file.name ); 

// set image 
var curImg:BitmapData = new BitmapData(); 
curImg.draw( mcPict ); 
} 

// File Browser 
var allTypes:Array = new Array(); 
var imageTypes:Object = new Object(); 
imageTypes.description = "Images (*.JPG;*.JPEG;*.JPE;*.GIF;*.PNG;)"; 
imageTypes.extension = "*.jpg; *.jpeg; *.jpe; *.gif; *.png;"; 
allTypes.push(imageTypes); 

var fileRef:FileReference = new FileReference(); 
fileRef.addListener(listener); 
fileRef.browse(allTypes); 
} 

```

thnx for your help!
