Draggable lines

I know Sinfiniti has this effect on his site, and I was just wondering how i would go about creating an effect like this? I don’t want code necessarily i just want help going in the right direction. \r\rjeremydecker.s5.com/progr…lines.html\r\rthats from his site (hope you don’t mind me posting to your site)

Ok, I’ll try to explain without any line of code. There are two ways actually :\r - start with a line like this : , 100 pixels high and 100 pixels wide, and set the center of the movie clip to the left end of the line. Then, all you have to do (I love to say that ! It used to piss me off whenever I read it in other people’s tutorials he he) is rescale the line to, for instance, the position of the mouse minus the position of the clip, on both the _x and the _y axes.\r\r - start with a straight line : – 100 pixles wide. You have to find the angle and the lenght between the two points, and then simply put the line there.\r\rTell us if you did it, I’d like to know. :smiley: \r\rpom 0] , I used it in my footer

if you create a diagonal line that is 100x100 pixels with it’s center point in the upper left you can do this to draw a line from one point to another:\rmcLine._x=mcPoint1._x;\rmcLine._y=mcPoint1._y;\rmcLine._xscale=mcPoint2._x-mcPoint1._x;\rmcLine._yscale=mcPoint2._y-mcPoint1._y;\r\ri tested it and it works! it’s also cleaner than the code i used for the example on my website.\r:) \rjeremy

well that was code, but thanks sin. And Pom, thanks as well. I was playing around with it and I couldn’t quite get it to work correctly.

couldn’t get it to work. this is what happens and its pissin me off! \r<embed src=“http://www.angelfire.com/dc/vidgame/game/Movie1.swf”></embed>\r\rand this is the code. and it should work, i don’t understand why its not. I put this code everywhere. On each MC in the timeline…and they all produced the same, or similar effects.\r<font color=blue>\ronClipEvent(enterFrame){\r_root.mcLine._x = _root.mcPoint1._x;\r_root.mcLine._y = _root.mcPoint1._y;\r_root.mcLine._xscale = _root.mcPoint2._x - _root.mcPoint1._x\r_root.mcLine._yscale = _root.mcPoint2._y - _root.mcPoint1._y\r}</font>

make sure all the clips have the right names.\ri tested the code and it works here…i’m getting confused too!\r:) \rjeremy

i’ll play with it later, but I know I had all the right names. I’m confused as hell tryin to figure out why it isn’t working…

post the fla and let us play with it!\r:) \rjeremy

heh, now it works for some reason. Thanks for the code. It helped a lot. I had something similar, but I was just screwing up minor things. Thanks.\r\r<embed src=“http://www.angelfire.com/dc/vidgame/game/Movie1.swf” height=100 width=100></embed>

here it is guys:\r<embed src=http://www.danalu.com/thoriphes/linedraw.swf>\r\rand here’s the fla:\r<a href=http://www.danalu.com/thoriphes/linedraw.fla>here</a>\r\renjoy!

OK, so you’re all clever people, you retrained the line to the minimal area. Because I ALWAYS have the same problem : the longer the line, the ticker too. And the uglier. Any ideas about that ?\rpom 0]

to make sure the line doesn’t get thicker set it’s stroke to ‘hairline’.\r:) \rjeremy

I’ve just scanned the area, no sign of hairline here, Sir !\rpom 0] , who can’t find it.

in the ‘stroke’ panel click on the drop-down menu at the top (it should say ‘solid’ next to a hoizontal line).\rscroll up to the top and it should say ‘hairline’.\r:) \rjeremy

yeah i forgot to use hairline when i did mine, cuz I was in a hurry to check.