# Get lowest depth on scripted background

**URL:** <https://forum.kirupa.com/t/get-lowest-depth-on-scripted-background/189684>\
**Category:** flash\
**Created:** [June 5, 2006, 9:58am UTC](https://forum.kirupa.com/t/get-lowest-depth-on-scripted-background/189684 "2006-06-05T09:58:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![williby27](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/williby27/32/1501_2.png) [@williby27](https://forum.kirupa.com/u/williby27)\
**Post date:** [June 5, 2006, 9:58am UTC](https://forum.kirupa.com/t/get-lowest-depth-on-scripted-background/189684/1 "2006-06-05T09:58:24Z")

</div>

Hey

I’ve coded a background using a duplicate movie method on a small jpg file.

Problem is, with the code i have used, i cant make my background have the LOWEST depth so that everything else in my flash movie is ON TOP of it.

Here is the code:

```auto

tileBG = function () {

tile_width = 15;
tile_height = 15;
//
x_max = Math.round(Stage.width/tile_width);
y_max = Math.round(Stage.height/tile_height);
for (x=0; x<=x_max; x++) {

for (y=0; y<=y_max; y++) {

bg = _root.attachMovie("square", "bg"+x+y, this.getNextHighestDepth());

bg._x = tile_width*x;
bg._y = tile_height*y;

}

}
;
};
tileBG();

```

I’m pretty sure its something to do with the  
bg = \_root.attachMovie(“square”, “bg”+x+y, this.getNextHighestDepth());

or the bg movieclip itself but i cant get it right, hope someone can get me on the right path.

Cheers

mrwilliby
