package{ import flash.display.Sprite; public class Puu5 extends Sprite{ public function Puu5(){ joonista(); y=50; x=200; } /* public function joonistaOks(x1:Number, y1:Number, x2:Number, y2:Number):void{ graphics.moveTo(x1, y1); graphics.lineTo(x2, y2); var vektorx:Number=x2-x1; var vektory:Number=y2-y1; var ristvx:Number=vektory; var ristvy:Number=-vektorx; if(Math.sqrt(vektorx*vektorx+vektory*vektory)>5){ joonistaOks(x2, y2, x2+ristvx/2, y2+ristvy/2); joonistaOks(x2, y2, x2-ristvx/2, y2-ristvy/2); } } */ public function joonista():void{ var oks:Oks1=new Oks1(); oks.joonistaOks(50, 100); addChild(oks); } } }