flash on 2012-11-23

by tepe
♥0 | Line 38 | Modified 2012-11-25 20:08:37 | 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/16sQ
 */

package {
    import flash.display.*;
    import flash.text.*;
    import flash.geom.*;
    public class FlashTest extends Sprite {
        private var s1:Sprite = new Sprite();
        public function FlashTest() {
            // write as3 code here..
            //draw();
            
            var x1:Number = 50;
            var x2:Number = 100;
            
            var z1:Number = 2.23;
    
            //スケール
            drawLine(x1,x2);
            x2 *= z1;
            drawLine(x1,x2);
            x2 /= z1;
            drawLine(x1,x2);
            
        }
        private function draw():void{
            var s:Sprite = new Sprite();
            addChild(s);
            s.x = 100;
            s.y = 100;
            s.graphics.lineStyle(1,0x000000);
            s.graphics.beginFill(0x00ff00,0.5);
            s.graphics.drawCircle(0,0,30);
            s.graphics.endFill();

        }
        
        private var dy:Number = 0;
        private var dx:Number = 0;
        private function drawLine(x1:Number=0,x2:Number=0):void{
            with(graphics){
                lineStyle(1,0x000000);
                moveTo(x1,dy);
                lineTo(x1+x2,dy);
            }
            dy += 20;

        }

        /*
            if(2 < zoom){
                map.scaleX *= 2;
                map.scaleY *= 2;
                zoom /= 2;
                map.x += map.x+base.x;
                map.y += map.y+base.y;
                    
                mapscale--;
                
            }
            else if(zoom < 1.0){
             
                map.x -= (map.x+base.x)/2;
                map.y -= (map.y+base.y)/2;
                zoom *= 2;
                map.scaleX /= 2;
                map.scaleY /= 2;
                    
                mapscale++;
                    
            }
            */
    }
}