hi guys thanks for the response. I've come to a similar conclusion myself.
as the maps are fairly simple, i'm going to draw them in the api, saving the total length as i go and then follow the route with a quick 'is this closer to the point clicked than the last point i drew' check and save that total and then use the two values to create a percentage of the total length. if i were to adjust this to include rounded corners, how would i find out what the length of the curveTo was? thanks again a On Wed, Aug 20, 2008 at 2:54 PM, Anthony Pace <[EMAIL PROTECTED]>wrote: > If anyone else has a better way I would love to hear it. > > Totally curved lines? or zig-zag with corners? or both? > > Try breaking the path travelled down to points. If you can calculate the > distance between the last point and a new point made, you just need to sum > up the values. > example map/ path travelled. > > start > .___. > .____\. > |.________. > ._______./ > finish > > just sum up the distances to find the total distance travelled. > > You will need to know basic the Pythagorean theorem, to find the length of > a hypotenuse/distance between to points for straight lines, and if you need > to calculate the curves it actually depends on the type of curve, so you > will need to know this info. > > more info on curves...found it on google, if you don't know how to do these > calculations it will take you a little time to work your way through the > math: > http://www.mathwords.com/a/arc_length_of_a_curve.htm > > hope that helps, > Anthony > > > > > allandt bik-elliott (thefieldcomic.com) wrote: > >> Hi guys >> >> I have a bit of maths problem to solve here and I've not found any answers >> on the Googles. >> >> I have several squiggly lines (they will be maps) and I need to find out, >> if >> a user clicks somewhere on one of the lines, how far along the line >> they've >> clicked. I also need to find out how long the line would be. >> >> How would I go about doing this, please? >> >> Hope you can help >> A >> _______________________________________________ >> Flashcoders mailing list >> [email protected] >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> >> > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

