In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

3D Ball

Get Adobe Flash player
by ll_koba_ll 22 Dec 2008
package
{

    import flash.display.*;
    
    public class Ball3DTest extends Sprite
    {

        public function Ball3DTest()
        {
            var ball:Ball3D = new Ball3D();
            addChild(ball);
            ball.x = 240;
            ball.y = 200;
        }

    }
}


import flash.display.*;
import flash.events.*;
import flash.geom.*;

class Ball3D extends Sprite
{

    public function Ball3D()
    {
        init();

    }

    private function init():void
    {

        var ball:Sprite = new Sprite();
        
        var fillType:String = GradientType.RADIAL;
        var colors:Array = [0xFFFFFF, 0x333333];
        var alphas:Array = [1, 1];
        var ratios:Array = [0x00, 0xFF];
        var matr:Matrix = new Matrix();
        matr.createGradientBox(-250, -250, Math.PI/2, 100, 80);
        var spreadMethod:String = SpreadMethod.PAD;
        var interpolation:String = InterpolationMethod.RGB;
        ball.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod,interpolation);  
        ball.graphics.drawCircle(0,0,100);
        
        addChild(ball);
        
    }

}