Dynamic lines

is it possible to dynammically create a line between two moving objects? so the start and end points of the line is attached to two objects?

Yep. You can check the drawing API tute in the AS tricks, and the drawing board tute.

pom :asian:

ah gerat, iā€™ll look into itā€¦

Iā€™m making sort of a random draw thingyā€¦ points a er moving as they were intended, I just thought Itā€™d be fun to makes some lines too! :slight_smile:

Iā€™ll post it when itā€™s doneā€¦ just a fun evening projectā€¦ :slight_smile:

Oki, I can draw the lines nowā€¦

but I want it to only draw ONE line per frameā€¦ it keeps copying itā€¦ I canā€™t get the clear thing to work properly! It erases the whole thing and nothing shows upā€¦

Oki now I got it to eraseā€¦ but NOW the line blinks 'cuz of fpsā€¦

What do I do?

I want it to present ONE single line, no blinkingā€¦

And that line has to be able to move between objectsā€¦

Itā€™s impossible (at least for me) to answer your questions if you donā€™t post the code, Eilsoe. Or the fla. :slight_smile:

hereā€™s my fla:

    [testlines.fla](http://www.avalon-rev.dk/test/testlines.fla) 

U can see it keeps making linesā€¦ thatā€™s not what iā€™m afterā€¦ but since I learned about these lines 20 minutes ago, I think itā€™s only fair I ask questions about it! :stuck_out_tongue:

Well you can have it as 2 frames.

First frame containing the actionsā€¦
i++;
_root.createEmptyMovieClip(ā€œtestā€, 1);
test.lineStyle(1, 0x000000, 100);
test.moveTo(i, i);
test.lineTo(_root._xmouse, _root._ymouse);

and the second frame containing the actionsā€¦
gotoAndPlay(1);

This worked for me, but I donā€™t know if it is exactly what you wanted it to do.

wellā€¦ with this method, the line also blinksā€¦ I set the fps to 30 just to speed things up.

This CAN be used, i mean, i can just set the lineto and moveto, to the xy of my moving objects, but the line still blinks every time the movie changes frame#!

can you follow meā€¦?

well whaddya knowā€¦

all of a sudden it stopped blinkingā€¦ I didnā€™t even change anythingā€¦

scaryā€¦ :-\

here it is guys!

It workedā€¦! My first experiment with lines! :stuck_out_tongue:

Iā€™m so proud of myselfā€¦ :slight_smile:

here: lines exp

Nice :slight_smile: But change that background color, pleaseā€¦ :stuck_out_tongue:

okeeey, try it again now! :stuck_out_tongue:

Better??

Hey, thatā€™s actually very good! Give it a little bit of colour, make it less than 25 lines and I think you can post this at Bit-101 without having to blush, Eilsoe :slight_smile:

pom :asian:

coool! :stuck_out_tongue:

Whaddya mean ā€œless than 25 linesā€ ā€¦? Code? or ā€œlinesā€ directlyā€¦?

what colorsā€¦? The fills??

Lines of code, yes. And yeah, you could put a fill there, donā€™t you think?

well there IS a fill! :slight_smile:

tha 50% alpha blueā€¦ but yeah, this could get cramped down to less than 25 linesā€¦ easilyā€¦

then I suspect having to loose the pic in back tooā€¦ since he states ā€œnothing in the libraryā€ā€¦

everything else is pure ASā€¦ soā€¦ no biggieā€¦ :stuck_out_tongue:

??? The one I saw before had no fill, no backgroundā€¦ I have to get some sleep.

well ok, but the one above DOES have a fill, and a pic of some greenish little troll thingyā€¦ try deleting your temp internet files and check againā€¦ otherwise, Iā€™ll post the fla for u, then u can see it! :evil:

Iā€™ll redo the code tomorrow.

I gotta get to bed nowā€¦ girlfriends calling me! :stuck_out_tongue:

Cā€™ya!