# Placement of movie clips using attachMovie()

**URL:** <https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837>\
**Category:** flash\
**Created:** [March 31, 2002, 1:51am UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837 "2002-03-31T01:51:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 31, 2002, 1:51am UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837/1 "2002-03-31T01:51:47Z")

</div>

Still plugging away, but I’ve run up against a problem that seems like it should be easy to fix, if I only knew how.\r\rMade a hairline for use in drawing lines with attachMovie(). Wanted to test it by making a “crosshair” at (100,100). You’d think:\r\rattachMovie(“line”,“line1”,1)\r this[“line1”].\_x=100;\r this[“line1”].\_y=100;\r this[“line1”].\_xscale=100;\r this[“line1”].\_yscale=0;\r\rattachMovie(“line”,“line2”,2)\r this[“line2”].\_x=100;\r this[“line2”].\_y=100;\r this[“line2”].\_xscale=0;\r this[“line2”].\_yscale=100;\r\ryoud’ think that would draw a cross-hair, right? Ok, even if you move the placement by (length/2) to account for the center of the line, it’s still off.\r\rSo, I guess my question is – how do you do a “crosshair” at position (100,100) using an attachMovie()?\r\rTHANKS!!\r\rShannon\r

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 31, 2002, 9:52am UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837/2 "2002-03-31T09:52:16Z")

</div>

Hey Shannon,\rHow is it going ?\rAbout your problem : the reason it’s not working is that the clip center is located at the left end of the line, right ? Try to set the center in the middle of the line, with the align tool, and your code works perfectly.\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 31, 2002, 9:55am UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837/3 "2002-03-31T09:55:18Z")

</div>

Otherwise this works :

```auto
 attachMovie("line", "line1", 1);\r\rthis["line1"]._x = 100;\r\rthis["line1"]._y = 100;\r\rthis["line1"]._xscale = 100;\r\rthis["line1"]._yscale = 0;\r\rattachMovie("line", "line2", 2);\r\rthis["line2"]._x = 100+_root.line2._width/2;\r\rthis["line2"]._y = 100-_root.line2._height/2;\r\rthis["line2"]._xscale = 0;\r\rthis["line2"]._yscale = 100;

```

pom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 31, 2002, 2:29pm UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837/4 "2002-03-31T14:29:56Z")

</div>

why not just do this:\rattachMovie(“line”,“line1”,1);\rattachMovie(“line”,“line2”,2);\rthis.line1.\_x=100;\rthis.line1.\_y=100;\rthis.line2.\_x=100;\rthis.line2.\_y=100;\rthis.line2.\_rotation=90;\r\rmake the line centered in the movie clip and either vertical or horizontal.\r:) \rjeremy

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 31, 2002, 4:19pm UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837/5 "2002-03-31T16:19:36Z")

</div>

Hey, Illyas! Hope all is well! I am on to something with this (thanks SO much for that example you sent over – I am trying to reverse-engineer it to me use).\r\rI still can’t figure this F^\*(%$ thing out! I have tried moving the center of the line from left to right to center! It works fine on the vertical lines, but horizontals are off by a lot. \r\rI’ve posted a copy of my basic FLA file for you to look at. It’s at [www.interintuit.com/help.fla\r\ranything](http://www.interintuit.com/help.fla%5Cr%5Cranything) anyone can help with would be GREATLY appreciated!\r\rThanks!\r\rShannon

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 31, 2002, 4:26pm UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837/6 "2002-03-31T16:26:35Z")

</div>

Thanks, Sin, but the “crosshair” is just a test for alignment. When that is done, I will need to draw several lines starting in various points at various angles. I just made the problem as simple as possible to not waste anyone’s time in the forum.\r\rShannon

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 31, 2002, 9:53pm UTC](https://forum.kirupa.com/t/placement-of-movie-clips-using-attachmovie/2837/7 "2002-03-31T21:53:32Z")

</div>

you could steal the code from this:\r[jeremydecker.s5.com/curved\_line.fla](http://jeremydecker.s5.com/curved_line.fla)\r:) \rjeremy
