I R Ub3r 1337

I have finally made it back into flash, And i have come up with an egregious hack for drawing a circle using the drawing API. Apparently using curveTo() is rather awkward for drawing a simple circle. This method uses the beginGradientFill() method:

_root.createEmptyMovieClip("grad",1);
 with (_root["grad"]) {
 colors = [0x000000,0x000000,0xffffff,0x000000,0x000000];
 alphas = [0,0,100,0,0];
 ratios = [0,124,128,132,255];
 /* adjust the 'spacing' of the middle three numbers to adjust line thickness */
 matrix = { matrixType:"box", x:0, y:0, w:400, h:400, r: (100/180)*Math.PI };
 beginGradientFill( "radial", colors, alphas, ratios, matrix );
 lineStyle(1,0x000000,100);
 moveTo(0,0);
 lineTo(400,0);
 lineTo(400,400);
 lineTo(0,400);
 lineTo(0,0);
 endFill();
 }

Put this code at the root level of your Flash file and run it. Nothing more need be done. Also, you can find a compiled version here . Sure, it’s not much to look at now, but just think of the possibilities!

Leave a Reply

Your email address will not be published. Required fields are marked *