# Attach Movie Problem

**URL:** <https://forum.kirupa.com/t/attach-movie-problem/212944>\
**Category:** flash\
**Created:** [January 15, 2007, 9:50pm UTC](https://forum.kirupa.com/t/attach-movie-problem/212944 "2007-01-15T21:50:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tolgainam](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tolgainam](https://forum.kirupa.com/u/tolgainam)\
**Post date:** [January 15, 2007, 9:50pm UTC](https://forum.kirupa.com/t/attach-movie-problem/212944/1 "2007-01-15T21:50:17Z")

</div>

Hello with the code below, first I create a empty movie clip and then attach another movieclip inside of it. The problem is I can not attach the movie clip to the topleft of the one I created first, it attaches someplace more top and left. Code is below.

```auto

MovieClip.prototype.createArtWork = function(sName, startx, starty, iWidth, iHeight, iColor) {
    var theMC = this.createEmptyMovieClip(sName, this.getNextHighestDepth());
    theMC.beginFill(iColor, iAlpha);
    theMC.moveTo(startx, starty);
    theMC.lineTo(startx+iWidth, starty);
    theMC.lineTo(startx+iWidth, starty+iHeight);
    theMC.lineTo(startx, starty+iHeight);
    theMC.lineTo(startx, starty);
    theMC.endFill();
    iHolder = theMC.attachMovie("holder","holder",this.getNextHighestDepth());
    theMC.onPress = startDrag;
    theMC.onRelease = theMC.onReleaseOutside=stopDrag;

```
