flash on 2012-1-13

by pitlord
♥0 | Line 26 | Modified 2012-01-13 15:10:49 | MIT License
play

ActionScript3 source code

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

package {
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.display.Sprite;
    
    import caurina.transitions.Tweener;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var stw:int = stage.stageWidth;
            var sth:int = stage.stageHeight;
            var tf:TextField = new TextField();
            tf.text = "hello world !!!";
            tf.width = stw;
            tf.y = (sth-tf.height)/2;
            tf.selectable = false;
            var fmt:TextFormat = new TextFormat();
            fmt.size = 50;
            fmt.color = 0xff0000;
            fmt.align = "center";
            
            tf.setTextFormat(fmt);
            
            
            
            addChild(tf);
            tf.x = stw;
            Tweener.addTween(tf , {x:0 ,delay:1 ,time:1 ,transition:"easeOutBack"});
            Tweener.addTween(tf , {x:-stw ,delay:5 ,time:1 ,transition:"easeinBack"});
        }
    }
}