forked from: testtest

by yasai
♥0 | Line 38 | Modified 2009-05-19 00:35:46 | MIT License
play

ActionScript3 source code

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

// forked from Nicol's testtest
package {
    import flash.display.*;
    import flash.text.*;
    import flash.events.Event;
    
    public class TEST extends Sprite{
        public function TEST(){
            //宣言
            var tf1:TextField = new TextField();
            var fmt1:TextFormat = new TextFormat();
            var mc:Sprite = new Sprite()
            addChild(mc);
            mc.addChild(tf1);
            //フォーマット
            fmt1.size = 30;
            fmt1.color = 0xFFFFFF
            
            tf1..defaultTextFormat = fmt1;
            tf1.text = "Welcome my code";
            tf1.background = true;
            tf1.backgroundColor = 0x00FF0F;
            tf1.width = 230;    //テキストBOX横幅
            tf1.height = 35;   //テキストBOX縦幅
            
            mc.x = 200;
            mc.y = 150;
            
            tf1.x = -(tf1.width / 2);
            tf1.y = -(tf1.height / 2);
            
            
            mc.addEventListener(Event.ENTER_FRAME,function(e:Event):void{
                mc.x +=1;
                mc.y +=1.5;
                mc.rotationY -= 5;
                tf1.alpha *=0.99;
                if(tf1.alpha <= 0.01){
                    mc.x = 200;
                    mc.y = 150;
                    mc.rotationZ = 0;
                    tf1.alpha = 1;
                }
            });
        }
    }
}

Forked