# Adding border around dynamically loaded thumbnails

**URL:** <https://forum.kirupa.com/t/adding-border-around-dynamically-loaded-thumbnails/221772>\
**Category:** flash\
**Created:** [April 7, 2007, 1:04pm UTC](https://forum.kirupa.com/t/adding-border-around-dynamically-loaded-thumbnails/221772 "2007-04-07T13:04:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maninderv](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@maninderv](https://forum.kirupa.com/u/maninderv)\
**Post date:** [April 7, 2007, 1:04pm UTC](https://forum.kirupa.com/t/adding-border-around-dynamically-loaded-thumbnails/221772/1 "2007-04-07T13:04:46Z")

</div>

Hi,

This question has probably been asked a number of times in this forum.

I searched and searched, read every reply, but there is nothing satisfactory posted till now.

I tried out all solutions posted, but almost every implementation was incomplete.

So, here is my question:

In the xml photogallery tutorial, if I want to have a border around a thumbnail (which is dynamically loaded), how do I do that?

Here is my function:

function thumbnails\_fn(k) {  
//trace(‘inside thumbnails\_fn’);  
var maxTWidth = 100;  
var maxTHeight = 67;  
thumbnail\_mc.createEmptyMovieClip(“t”+k, thumbnail\_mc.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
//target\_mc.\_y = 0+(eval(“thumbnail\_mc.t”+k).\_height+7)\*k;  
target\_mc.\_y = 0+(67+7)_k;  
if (target\_mc.\_width) {  
/_ Lets get the height and width of the loaded thumbnail \*/  
var w = target\_mc.\_width;  
var h = target\_mc.\_height;

```
        /* Lets proportionately resize it based on the space we have 100x67 */
        if (w&gt;maxTWidth) {
            h = h*maxTWidth/w;
            w = maxTWidth;
        }
        if (h&gt;maxTHeight) {
            w = w*maxTHeight/h;
            h = maxTHeight;
        }
        target_mc._width = w;
        target_mc._height = h;
    }
    target_mc.pictureValue = k;
    target_mc.onRelease = function() {
        p = this.pictureValue-1;
        nextImage();
    };
    target_mc.onRollOver = function() {
        this._alpha = 50;
    };
    target_mc.onRollOut = function() {
        this._alpha = 100;
    };
};

image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);

```

}

Where do I fit in the drawOutline function and what should I write in it.

I banged my head enough with the DrawingAPI but I could not get it to work.

Help appreciated and wanted urgently 🙂

Thanks,  
Mandy.
