Duplicate Background Tutorial

Hey there,
I’m trying to fill a movieclip with a seamless pattern, so in essense its pretty much the same as Kirupa’s Duplicate Background tutorial. I’m having trouble converting the AS from filling the background to filling a movieclip

Here’s the original code:
[AS]tileBG = function () {
tile_width = 34;
tile_height = 34;
//
x_max = Math.round(Stage.width/tile_width);
y_max = Math.round(Stage.height/tile_height);
trace(x_max);
trace(y_max);
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_widthx;
bg._y = tile_height
y;
}
}
};
tileBG();[/AS]

I’ve tried replacing _root with the name of my clip, but that didn’t seem to do the trick, if anyone can point me in the right direction I’d appreciate it :slight_smile:

J.