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

COLORFUL

it's just a textfield
Get Adobe Flash player
by matacat 11 Mar 2010
    Embed
/**
 * Copyright matacat ( http://wonderfl.net/user/matacat )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/l4gH
 */

//  it's just a textfield

package
{
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.geom.Matrix;
    import flash.text.TextField;
    import flash.text.TextFormat;
    
    public class COLORFUL extends Sprite
    {
        public function COLORFUL()
        {
            var wz:Number = stage.stageWidth;
            var hi:Number = stage.stageHeight;
            
            var m:Matrix = new Matrix();
            m.createGradientBox(wz, hi, Math.PI / 2);
            
            graphics.beginGradientFill(
                "linear",
                [0xFF0000, 0xFFFF00, 0x00FF00, 0x00FFFF, 0x0000FF, 0xFF00FF, 0xFF0000],
                [       1,        1,        1,        1,        1,        1,        1],
                [       0,     42.5,       85,    127.5,      170,    212.5,      255],
                m, "pad", "rgb" );
            graphics.drawRect(0, 0, wz, hi);
            
            var c:Sprite = new Sprite();
            c.graphics.beginFill(0);
            c.graphics.drawRect(0, 0, wz, hi);
            c.blendMode = "layer";
            addChild(c);
            
            var t:TextField  = new TextField();
            var f:TextFormat = new TextFormat(null, 50, 0, true);
            t.autoSize = f.align = "center";
            t.defaultTextFormat = f;
            t.type      = "input";
            t.border    = true;
            t.multiline = true;
            t.text      = "C\nO\nL\nO\nR\nF\nU\nL"
            t.x         = wz - t.width >> 1;
            t.blendMode = "erase";
            c.addChild(t);
        }
    }
}