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

[FF] String Blur

Get Adobe Flash player
by bradsedito 22 Jun 2011
// forked from Kay's String Blur
package {
    import flash.display.Sprite;
    import flash.display.BitmapData;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.text.TextFieldAutoSize;
    import flash.filters.BevelFilter;
    import flash.filters.BlurFilter;
    import flash.events.Event;
    import flash.geom.Point;
    [SWF(backgroundColor=0x000000, width=400, height=400, frameRate=150)]
    public class Take01 extends Sprite {
        private const SW:Number = stage.stageWidth;
        private const SH:Number = stage.stageHeight;
        private var bitmapData:BitmapData;
        private var tField:TextField;
        private var wrapper:Sprite;
        private var fBevel:BevelFilter;
        private var fBlur:BlurFilter;
        private var point:Point = new Point(0,0);
        public function Take01():void {
            fBevel = new BevelFilter();
            fBevel.shadowColor = 0x999999;
            fBevel.highlightColor = 0x0099FF;
            fBlur = new BlurFilter(2,2,3);
            wrapper = new Sprite();
            wrapper.x = stage.stageWidth/2;
            wrapper.y = stage.stageHeight/2;
            addChild(wrapper);
            var tFormat:TextFormat = new TextFormat();
            tFormat.size = 100;
            tFormat.font = "Arial Black";
            tFormat.color = 0xffffff  
            tField = new TextField();
            tField.defaultTextFormat = tFormat;
            tField.selectable = false;
            tField.autoSize = TextFieldAutoSize.LEFT;
            tField.text = "____";
            tField.x = -tField.width/2;
            tField.y = -tField.height/2;
            wrapper.addChild(tField);
            wrapper.addEventListener(Event.ENTER_FRAME, rotate);
            bitmapData = new BitmapData(SW,SH,true,0x000000);
            graphics.beginBitmapFill(bitmapData);
            graphics.drawRect(0,0,SW,SH);
            graphics.endFill();
        }
        private function rotate(e:Event):void {
            e.target.rotationZ+=3;
            fBevel.angle = -e.target.rotationZ+45;
            tField.filters = [fBevel];
            bitmapData.draw(stage);
            bitmapData.applyFilter(bitmapData,bitmapData.rect,point,fBlur);
        }
    }
}