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!
Iāll post it when itās doneā¦ just a fun evening projectā¦
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.
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!
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!
Iām so proud of myselfā¦
here: lines exp
Nice But change that background color, pleaseā¦
okeeey, try it again now!
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
pom :asian:
coool!
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!
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ā¦
??? 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!
Cāya!