Drawing controlled lines in Flash

hurtlingturtle
hurtlingturtle used Ask the Experts™
on
Hi,
I am trying to draw a line between 2 points, this is made more complex as the line must be a curved line.  Also, the 2 points that it goes between can also change, depending on variables that are input into the movie.
Does anyone have any ideas about how this could be done?
cheers
Bruce
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Found it, but I donot know if this is helpfull!??

http://www.flashkit.com/movies/Scripting/Automati-Jason_Ro-352/index.php

The above SWF (the zip contains a FLA as well) allows you to drag two points where in between a line is drawn.

In the downloadable this is a straight line, but you can make it curved as well. The downloadable contains also the explaination of how it is done.


Otherwise the following download:
http://www.flashkit.com/movies/Applications/SimpleDr-Hrant_Mu-756/index.php

This lets the user draw a square, line or circel by specifying the start and end point with the mouse.

Hope it helps!
Commented:
have a play around with this..

createEmptyMovieClip("line",1)
with(line){
     lineStyle(1, 0x333333,100);
     moveTo(0,300)
     curveTo(200,500,400,100)
}


1st line..creates a clip as a 'container'
2nd..targets the clip
3rd..1=line width, 0x333333=colour, 100=alpha
4th..0=x, 300=y
5th..200=controlX, 500=controlY,400=anchorX, 100=anchorY

use the variables to change the value of the control X and Y positions..to change the curve of the line.

Z

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial