# Resize the mc best to the users screen resolution

**URL:** <https://forum.kirupa.com/t/resize-the-mc-best-to-the-users-screen-resolution/243200>\
**Category:** Uncategorized\
**Created:** [November 4, 2007, 8:15am UTC](https://forum.kirupa.com/t/resize-the-mc-best-to-the-users-screen-resolution/243200 "2007-11-04T08:15:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abramelin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/abramelin/32/3256_2.png) [@abramelin](https://forum.kirupa.com/u/abramelin)\
**Post date:** [November 4, 2007, 8:15am UTC](https://forum.kirupa.com/t/resize-the-mc-best-to-the-users-screen-resolution/243200/1 "2007-11-04T08:15:08Z")

</div>

hi i have this code that loads my large images on my site but it does not reduce them it shows the image with original resol only so if the user looks an image that’s resol is 1600_1200 and their own screen resol is 1024_768 then they cannot see the images all part. so what i want is to implement a “reduce to best fit if their screen resol is lesser then the image resol” feature for this code. if anyone can help i will be very gratefull thanks.  
this is the code that loads the large movieclip

```auto

    var mcl2:MovieClipLoader = new MovieClipLoader();
    var mcl_listener2:Object = new Object();
    mcl2.addListener(mcl_listener2);

    mcl_listener2.onLoadProgress = function():Void {
       mainTL.attachMovie("mc.loader", "largeloader_mc", 50000, {_x:Stage.width/2, _y:Stage.height/2});
    };

    mcl_listener2.onLoadInit = function(mc:MovieClip):Void {

       // remove loader
       mainTL.largeloader_mc.removeMovieClip();

       // set mc's for quick access
       var holder:MovieClip = mc;
       var image:MovieClip = mc._parent;
       var border:MovieClip = mc._parent.border;

       if (loadedFirst != true) {
             // center holder
             holder._x = -holder._width/2;
             holder._y = -holder._height/2;

             // border
             border.colorTo(largeImageBorderColor, 0);
             border._width = border._height = 0;
             border.tween(["_width", "_height"], [holder._width + largeImageBorder, holder._height + largeImageBorder], 1, 'easeInOutExpo');

             // attach prev | next
             if (!image.prev_mc) {
                image.attachMovie("arrow.prev", "prev_mc", 51, {_x:0 - Math.round(holder._width/2) - 13, _y:0, _alpha:0});
                image.attachMovie("arrow.next", "next_mc", 50, {_x:Math.round(holder._width/2) - 10, _y:0, _alpha:0});
                image.prev_mc.alphaTo(100, 1, 'easeInOutSine', .75);
                image.next_mc.alphaTo(100, 1, 'easeInOutSine', .75);

                image.prev_mc.onRelease = function() {
                   switchImage("prev");
                }
                image.next_mc.onRelease = function() {
                   switchImage("next");
                }

             }

             fadeDelay = 0.5;
             image._visible = true;
             loadedFirst = true;
             
       } else {
             // just resize things
             image.prev_mc.slideTo(0 - Math.round(holder._width/2) - 13, null, 1, 'easeInOutExpo');
             image.next_mc.slideTo(Math.round(holder._width/2) - 10, null, 1, 'easeInOutExpo');
             holder.slideTo(-holder._width/2, -holder._height/2, 1, 'easeInOutExpo');
             border.tween(["_width", "_height"], [holder._width + largeImageBorder, holder._height + largeImageBorder], 1, 'easeInOutExpo');
             fadeDelay = 0;
       }

       // fade in
       holder._alpha = 0;
       holder.alphaTo(100, 1, 'easeInOutSine', fadeDelay);

       // populate copy
       populateCopy(image, holder, thumbSelected);
    };

    mcl_listener2.onLoadError = function(mc:MovieClip, errorCode:String):Void {
       if (errorCode == "URLNotFound") {
          throwError("The URL you requested could not be found.");
       }
    };

```
