flash on 2012-6-6

by tepe
♥0 | Line 49 | Modified 2012-06-06 18:18:12 | 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/kbYG
 */

package {
    import flash.display.*;
    import flash.text.*;
    import flash.events.*;
    
    public class FlashTest extends Sprite {
        private var s1:Sprite = new Sprite();
        private var s2:Sprite = new Sprite();
        private var s3:Sprite = new Sprite();
        
        public function FlashTest() {
            // write as3 code here..
            init();
            //sub();
            
        }
        private function init():void{
            with(s1.graphics){
                lineStyle(1,0);
                beginFill(0xff0000);
                drawCircle(0,0,30);
                endFill();
            }
            s1.x=50;
            s1.y=200;
            s1.scaleX = s1.scaleY = 1.5;
            addChild(s1);
            
            with(s2.graphics){
                lineStyle(1,0);
                beginFill(0x00ff00);
                drawCircle(0,0,30);
                endFill();
            }
            s2.x=10;
            s2.y=10;
            s2.scaleX = s2.scaleY = 0.5;
            s1.addChild(s2);
            
            with(s3.graphics){
                lineStyle(1,0);
                beginFill(0x0000ff);
                drawCircle(0,0,30);
                endFill();
            }
            s3.x=30;
            s3.y=40;
            s3.scaleX = s3.scaleY = 0.5;
            s2.addChild(s3);
            
            s1.graphics.drawRect(-30,-30,s1.width,s1.height);
        }
        //
        private function sub():void{
            addChild(s2);
        }


    }
}