# Picture Gallery and thumbnail doubts

**URL:** <https://forum.kirupa.com/t/picture-gallery-and-thumbnail-doubts/100313>\
**Category:** Uncategorized\
**Created:** [January 28, 2004, 12:59am UTC](https://forum.kirupa.com/t/picture-gallery-and-thumbnail-doubts/100313 "2004-01-28T00:59:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghjr](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@ghjr](https://forum.kirupa.com/u/ghjr)\
**Post date:** [January 28, 2004, 12:59am UTC](https://forum.kirupa.com/t/picture-gallery-and-thumbnail-doubts/100313/1 "2004-01-28T00:59:46Z")

</div>

Here’s the situation: I’m making a script that will dynamically load JPG’s from a file and will eventually display each JPG’s thumbnail them side by side. I’ve got the code going and would like to know any suggestions for corrections.  
[AS]  
\*\*// Importing Images

p = 0;  
x = 20;  
y = 20;  
for(i=0;i\<4;i++){  
\_root.createEmptyMovieClip(“clip”+i, i+1)  
loadMovie(“pic”+i+’.jpg’,\_root[“clip”+i]);  
\_root[“clip”+i].\_x = x;  
\_root[“clip”+i].\_y = y;

```
            //attempt to change position for next image
             x = +100;
 y = +100;

}

_root.onEnterFrame = function(){
            _root["pic"+p+'.jpg'].swapDepths(_root);
             
                         //attempt to create thumbnails
                         if(this._width&gt;768){
	this._width = 150;
                            this._height = 113;
             }
             else {
	this._width = 150;
                            this._height = 200;
             }
            p++;
}

```

\*\*[/AS]  
Right now I’m having troubles with the resizing of images: the if statement doesn’t seem to work (or maybe resizing in flash distorts the images). Any tips or suggestions for the code?

Thanks!! :pleased:
