In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: curveTo

Get Adobe Flash player
by matsuwo 16 Oct 2011
    Embed
/**
 * Copyright matsuwo ( http://wonderfl.net/user/matsuwo )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/vaTB
 */

// forked from Sho.Anma's 010215
// forked from Sho.Anma's forked from: 010212
// forked from Sho.Anma's 010212
package {
    import flash.net.NetStream;
    import flash.display.MovieClip;
    public class Index extends MovieClip {
        public function Index() {
            // write as3 code here..
         var repeatCount:int = 5;
        var i:Number
           for(i = 0;i < repeatCount; i++){
               var centerX:Number = 100;//Math.round(Math.random()*400) + 50;
               var centerY:Number = 200;//Math.round(Math.random()*400) + 50;
               var r:Number = 100;//Math.ceil(Math.random()*100);
               
               var C1:DrawCircle = new DrawCircle(centerX,centerY,r);
               //C1.x = 100;
               addChild(C1);
               C1.x = 100; 
               var C2:DrawCircle = new DrawCircle(centerX,centerY,r);
               addChild(C2);
               C2.x = 200;
               C2.y = 200;
               //removeChild(C1); 
               //addChild(new DrawCircle(centerX,centerY,r));
               }
         
         
             }                           
        }
    }


import flash.display.MovieClip;
class DrawCircle extends MovieClip{
    public function DrawCircle(centerX:Number, centerY:Number,r:Number){
            
            graphics.lineStyle(2, 0x000000);
            graphics.moveTo(centerX+r, centerY);
          
            graphics.lineStyle(2,0x00ff00);
            graphics.curveTo(r+centerX, Math.tan(Math.PI/8)*r+centerY,
                            Math.sin(Math.PI/4)*r+centerX,
            Math.sin(Math.PI/4)*r+centerY);
            
            graphics.lineStyle(2,0x00ffff);
            graphics.curveTo(Math.tan(Math.PI/8)*r+centerX,r+centerY,
                            centerX,r+centerY);
            
            graphics.lineStyle(2,0xff0000);
            graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX, r+centerY,
                            -Math.sin(Math.PI/4)*r+centerX,
            Math.sin(Math.PI/4)*r+centerY);
            
            graphics.lineStyle(2,0x0000ff);
            graphics.curveTo(-r+centerX,Math.tan(Math.PI/8)*r+centerY,
                            -r+centerX,centerY); 

            graphics.lineStyle(2,0x00ff00);                            
             graphics.curveTo(-r+centerX, -Math.tan(Math.PI/8)*r+centerY,
                            -Math.sin(Math.PI/4)*r+centerX,
            -Math.sin(Math.PI/4)*r+centerY);
   
            graphics.lineStyle(2,0xff0000);
            graphics.curveTo(-Math.tan(Math.PI/8)*r+centerX,-r+centerY,
                            centerX,-r+centerY);
                  
           /*graphics.curveTo(Math.tan(Math.PI/8)*r+centerX, -r+centerY,
                           Math.sin(Math.PI/4)*r+centerX,
            -Math.sin(Math.PI/4)*r+centerY);
          
            graphics.curveTo(r+centerX,-Math.tan(Math.PI/8)*r+centerY,
                            r+centerX,centerY);    */
        }
    }