Dynamic gradients

This garish set of gradients is dynamically created using MovieClip.beginGradientFill(). It is supported in Gnash from version 0.8.7.

The ActionScript for this SWF follows. It can be compiled with makeswf from libming.org, which doesn't insist on proper declaration of variables. For stricter compilers you may have to adjust the code.

// Make SWF8 Matrix visible for convenience.
ASSetPropFlags(_global, "flash", 0, 5248);

drawBox = function(x, y, mc, o) {
    x += 5;
    y += 5;
    s = 90;
    with (mc) {
        matrix = new flash.geom.Matrix;
        matrix.createGradientBox(s, s, o.rotation, x + o.offsetX,
            y + o.offsetY);
        beginGradientFill(o.fillType, o.colors, o.alphas, o.ratios, matrix);
        moveTo(x, y);
        lineTo(x + s, y);
        lineTo(x + s, y + s);
        lineTo(x, y + s);
        lineTo(x, y);
        endFill();
    };
};

createEmptyMovieClip("grad", 150);

with(grad) {

    o = {};
    o.fillType = "linear";
    o.rotation = 0;

    // Linear gradients
    x = 0;
    y = 0;

    // shape 1
    o.colors = [0x0000ff, 0xffff00, 0x00ffff];
    o.alphas = [100, 100, 100];
    o.ratios = [0, 0x30, 0xff];
    drawBox(x, y, grad, o);
    
    // shape 2
    x += 100;
    o.colors = [0x0000ff, 0xffffff];
    o.alphas = [100, 100];
    o.ratios = [0, 0xff];
    drawBox(x, y, grad, o);
    
    // shape 3
    x += 100;
    o.colors = [0x0000ff, 0xffffff, 0xff00ff];
    o.alphas = [100, 100, 100];
    o.ratios = [0, 0xff / 2, 0xff];
    o.rotation = Math.PI / 4;
    drawBox(x, y, grad, o);

    // shape 4
    x += 100;
    o.colors = [0x0000dd, 0xfddfff, 0x440044];
    o.alphas = [100, 100, 100];
    o.ratios = [0, 0xff / 2, 0xff];
    o.rotation = Math.PI / 4 * 3;
    drawBox(x, y, grad, o);

    // shape 5
    x += 100;
    o.colors = [0x0000ff, 0xffffff, 0x00ff00];
    o.alphas = [100, 100, 100];
    o.ratios = [0, 0xff / 2, 0xff];
    o.rotation = Math.PI / 8 * 5;
    drawBox(x, y, grad, o);

    // Radial gradients
    o.fillType = "radial";

    x = 0;
    y += 100;

    // shape 6
    o.colors = [0xff0000, 0xffff00];
    o.alphas = [100, 100];
    o.ratios = [0, 0xff];
    drawBox(x, y, grad, o);
    
    // shape 7
    x += 100;
    o.colors = [0x0000ff, 0xffffff];
    o.alphas = [100, 100];
    o.ratios = [0, 0xff];
    drawBox(x, y, grad, o);
    
    // shape 8
    x += 100;
    o.colors = [0x0000ff, 0xffffff, 0xff00ff];
    o.alphas = [100, 100, 100];
    o.ratios = [0, 0xff / 2, 0xff];
    drawBox(x, y, grad, o);

    // shape 9
    x += 100;
    o.colors = [0x0000ff, 0xffffff, 0xee5577];
    o.alphas = [100, 100, 100];
    o.ratios = [0, 0xff / 2, 0xff];
    o.offsetX = -30;
    o.offsetY = -30;
    drawBox(x, y, grad, o);

    // shape 10
    x += 100;
    o.colors = [0x0000ff, 0xffffff, 0x00ff00];
    o.alphas = [100, 100, 100];
    o.ratios = [0, 0xff / 2, 0xff];
    o.offsetX = 30;
    o.offsetY = 30;
    drawBox(x, y, grad, o);

}