forked from: 3D2

by kenta forked from 3D2 (diff: 4)
♥0 | Line 29 | Modified 2009-09-29 22:38:14 | MIT License
play

ActionScript3 source code

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

// forked from kenta's 3D2
package {
    import flash.display.MovieClip;
    import flash.display.Shape;
    import flash.display.Graphics;
    import flash.events.Event;
    import flash.geom.*;

    public class ZAxisExample1 extends MovieClip {
        private var ellipse1Back:int = 1;
        private var ellipse2Back:int = 1;
        private var depth:int = 1000;
        
        public function ZAxisExample1():void {
            var countainer
            var ellipse1 = drawEllipse((this.stage.stageWidth / 2) - 100, 
                                      (this.stage.stageHeight / 2), 100, 80, 0);
                  //yの値を変えてみる
            var ellipse2 = drawEllipse((this.stage.stageWidth / 2) - 50, 
                                      (this.stage.stageHeight / 2), 100, 80, 0);

            this.addChild(ellipse1);
            this.addChild(ellipse2);
            
 
        }

        private function drawEllipse(x:Number, y:Number, w:Number, h:Number, z:Number):Shape {
            var s:Shape = new Shape();                            
            s.z = z;
            s.graphics.beginFill(0xFF0000);
            s.graphics.lineStyle(2);
            s.graphics.drawEllipse(x, y, w, h);
            s.graphics.endFill();
            return s;
        }

 
}}