RE: [Flashcoders] Algorithm to find center of an irregular shape

2006-09-22 Thread Danny Kodicek
In this particular application, the shapes are the areas between the lines created when graphing several time series on a chart (e.g., the price of several stocks, graphed over time) It sounds to me like what you need is actually some kind of line of best fit rather than a centre. The usual

RE: [Flashcoders] Algorithm to find center of an irregular shape

2006-09-21 Thread Mike Keesey
Look into MovieClip.getBounds() and MovieClip.getRect(). For example, you could use: import flash.geom.Point; // ... function getCenter(shape:MovieClip):Point { var bounds:Object = shape.getBounds(this); var center:Point = new Point(); center.x = (bounds.xMax -