# Smoothing thumbnails in a loop

**URL:** https://forum.kirupa.com/t/smoothing-thumbnails-in-a-loop/322203
**Category:** Uncategorized
**Created:** [May 13, 2011, 10:50pm UTC](https://forum.kirupa.com/t/smoothing-thumbnails-in-a-loop/322203 "2011-05-13T22:50:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![phastings](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@phastings](https://forum.kirupa.com/u/phastings)
#### Post date: [May 13, 2011, 10:50pm UTC](https://forum.kirupa.com/t/smoothing-thumbnails-in-a-loop/322203/1 "2011-05-13T22:50:17Z")

</div>

I’m loading a bunch of thumbnail images into a grid. I can get them to load fine but I need to turn the smoothing on on them and when I do this only one image seems to appear. Here is the code:

//here’s where the images are called:  
function callThumbs():void {  
for (var i:Number = 0; i \< my\_total; i++) {

```
    var thumb_url = my_images*.@THUMB;
    
    var thumb_loader = new Loader();
    thumb_loader.load(new URLRequest(thumb_url));
    thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
    
    
    
    thumb_loader.name = i;

    thumb_loader.x = (my_thumb_width)*x_counter;
    thumb_loader.y = (my_thumb_height)*y_counter;

    if (x_counter+1 &lt; columns) {
        x_counter++;
    } else {
        x_counter = 0;
        y_counter++;
    }

}

```

}

Here’s what happens after the thumbs are loaded. If i just place the loader all of the images show up but when I try and turn the loader into a bitmap and smooth it then only one image is appearing

function thumbLoaded(e:Event):void {

```
var my_thumb:Loader = Loader(e.target.loader);

var bitMap:Bitmap = Bitmap(my_thumb.content);//get the loaders content as a bitmap
bitMap.smoothing = true;//turn on smoothing
bitMap.width = 166;
bitMap.height = 249;

var temp:MovieClip = new MovieClip();
temp.addChild(bitMap);

container_mc.addChild(temp);

```

//THE CODE BELOW COMMENTED OUT WORKS BUT NOT THE STUFF ABOVE  
//my\_thumb.width = 166;  
//my\_thumb.height = 249;  
//container\_mc.addChild(my\_thumb);

my\_thumb.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded);  
}
