package { import flash.display.Sprite; import flash.events.Event; import flash.geom.Point; import af.graphics.CatmullRom; public class CatmullRomExample extends Sprite { public function CatmullRomExample() { addEventListener(Event.ADDED_TO_STAGE, init); } public function init(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, init); // be a tidy kiwi // set the line style graphics.lineStyle(3.0,0x40c050); // build an array of flash.geom.Point objects var points:Array = new Array(); points.push(new Point(200,200)); points.push(new Point(240,120)); points.push(new Point(270,220)); points.push(new Point(300,180)); points.push(new Point(250,140)); points.push(new Point(170,300)); // draw the curve CatmullRom.draw(graphics, points); points = null; // tidy kiwi } } }