Hello world!!

by komatsu
テスト用
♥0 | Line 25 | Modified 2013-01-05 10:14:34 | MIT License
play

ActionScript3 source code

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

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();//TextFieldオブジェクトの作成
            tf.text = "Hello world !!";//文字の入力
            tf.width = stw;//横幅の設定
            tf.x = stw;//座標の設定
            tf.y = (sth - tf.height)/2;//座標の設定
            addChild(tf);//Spriteを拡張したFlashTestの子供としてaddChild
            
            var fmt:TextFormat = new TextFormat();//TextFormatオブジェクトの作成
            fmt.align = "center";//中央揃え
            fmt.size = 50;//サイズの設定
            fmt.color = 0x0000ff;//色の設定
            
            tf.setTextFormat(fmt);//Textformatの適用
            
            Tweener.addTween(tf , { x:0 , delay:1 , time:1 ,transition:"easeOutCubic"});
            
            Tweener.addTween(tf , { x:-stw , delay:5 , time:1 ,transition:"easeInCubic"});
        }
    }
}