# HELP - dynamic border + shadow

**URL:** https://forum.kirupa.com/t/help-dynamic-border-shadow/273673
**Category:** flash
**Created:** [October 18, 2008, 6:28pm UTC](https://forum.kirupa.com/t/help-dynamic-border-shadow/273673 "2008-10-18T18:28:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![adstudio3d](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@adstudio3d](https://forum.kirupa.com/u/adstudio3d)
#### Post date: [October 18, 2008, 6:28pm UTC](https://forum.kirupa.com/t/help-dynamic-border-shadow/273673/1 "2008-10-18T18:28:48Z")

</div>

I am building a gallery of images.

I would like to load each image into its container by using the containers \<instance name\> (not sure how to write this : (“images/”+instanceName+".jpg");

Then add a 5px border and drop shadow to each gallery item dynamically based on the image size (They are all different sizes).

I’ve been searching and playing around but could not get exactly what i’m looking for…

Here is the code I’m working with now which kind of works  
not loading in the way i want however

Actionscript on imageContainer1  
ActionScript Code:  
[LEFT][COLOR=#0000FF]onClipEvent[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“photo”[/COLOR], [COLOR=#FF0000]“photo1”[/COLOR], [COLOR=#000080]5[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“shadow”[/COLOR], [COLOR=#FF0000]“shadow1”[/COLOR], [COLOR=#000080]4[/COLOR][COLOR=#000000])[/COLOR];  
shadowAmount = [COLOR=#000080]5[/COLOR];  
borderAmount = [COLOR=#000080]3[/COLOR];  
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]shadow1[/COLOR].[COLOR=#0000FF]\_width[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]photo1[/COLOR].[COLOR=#0000FF]\_width[/COLOR]+shadowAmount;  
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]shadow1[/COLOR].[COLOR=#0000FF]\_height[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]photo1[/COLOR].[COLOR=#0000FF]\_height[/COLOR]+shadowAmount;  
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]shadow1[/COLOR].[COLOR=#0000FF]\_x[/COLOR] = shadowAmount;  
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]shadow1[/COLOR].[COLOR=#0000FF]\_y[/COLOR] = shadowAmount;  
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]border1[/COLOR].[COLOR=#0000FF]\_width[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]photo1[/COLOR].[COLOR=#0000FF]\_width[/COLOR]+borderAmount;  
[COLOR=#0000FF]this[/COLOR].[COLOR=#000080]border1[/COLOR].[COLOR=#0000FF]\_height[/COLOR] = [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]photo1[/COLOR].[COLOR=#0000FF]\_height[/COLOR]+borderAmount;  
[COLOR=#000000]}[/COLOR]  
[/LEFT]

I need to somehow replace this  
ActionScript Code:  
[LEFT][COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]attachMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“photo”[/COLOR], [COLOR=#FF0000]“photo1”[/COLOR], [COLOR=#000080]5[/COLOR][COLOR=#000000])[/COLOR];  
[/LEFT]

so that it will load an external image using something like this  
ActionScript Code:  
[LEFT]container.[COLOR=#0000FF]loadMovie[/COLOR]COLOR=#000000[/COLOR];  
[/LEFT]

But the problem is, when I just replace it with loadMovie,  
the shadow is no longer added.

Also, if I add this  
ActionScript Code:  
[LEFT]imageName = [COLOR=#FF0000]“name of file to load”[/COLOR];  
[/LEFT]

In the onEnterFrame or on the actual frame, it is not being recognized and is trying to load “[http://www.ultrashock.com/forums/images/.jpeg](http://www.ultrashock.com/forums/images/.jpeg)” instead of “inages/test1.jpg”

Please, any help would be greatly appreciated. Thanks
