flash on 2013-8-8

by tepe
♥0 | Line 34 | Modified 2013-08-08 13:56:18 | MIT License
play

ActionScript3 source code

/**
 * Copyright tepe ( http://wonderfl.net/user/tepe )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/q8d5
 */

package {
    import flash.events.*;
    import flash.display.*;
    import flash.text.*;
    import flash.filters.GlowFilter;
    
    public class FlashTest extends Sprite {
        private var color1:uint = 0x0000ff;
        private var glow:GlowFilter;
        private var outLine:GlowFilter;
        private var tf:TextField = new TextField();
        private var tfGlow:TextField = new TextField();
        private var format:TextFormat = new TextFormat();
        private var base:Sprite = new Sprite();
        private var baseGlow:Sprite;
        public function FlashTest() {
            // write as3 code here..
            glow = new GlowFilter(color1, 0.3, 3, 3, 10, 7, false, true);
            outLine = new GlowFilter(0x000000,0.5,2,2,2,2,false,true);
            
            tfGlow.filters = [outLine];
            format.size = 70;
            tf.textColor = 0xffffff;
            //base.filters = [glow];
            tfGlow.defaultTextFormat = tf.defaultTextFormat = format;
            tfGlow.text = tf.text = "test";
            base.addChild(tfGlow);
            base.addChild(tf);
            addChild(base);
            
            stage.addEventListener(Event.ENTER_FRAME,onChange);
            tf.type = "input";
            tfGlow.width = tf.width = tf.textWidth+10;
        }
        private function onChange(e:Event):void{
            //glow = new GlowFilter(color1, 0.3, 3, 3, 10, 7, false, true);
            //tf.filters = [glow];
            tfGlow.width = tf.width = tf.textWidth+10;
            //if(tf.text!=tfGlow.text)tfGlow.text=tf.text;
        }

    }
}

Forked