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: 継承

Get Adobe Flash player
by hacker_yk666qry 08 Jan 2010
    Embed
/**
 * Copyright hacker_yk666qry ( http://wonderfl.net/user/hacker_yk666qry )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/4b66
 */

// forked from hacker_yk666qry's 継承
// forked from hacker_nekomaru's flash on 2009-2-24
package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.utils.*;
    public class FlashTest extends Sprite {
        public function FlashTest() {
        	init();
        }

   		public function init():void {
   			
            var test:ITest;
           
   
            
            test = new CTest2();
            addChild( test.getSprite() );
   		}
    }

}


import flash.display.Sprite;

interface ITest{
    function getSprite():Sprite
}

class CTest implements ITest{
    public function getSprite():Sprite{ 
        var temp:Sprite = new Sprite();
        temp.graphics.beginFill( 0xffcc00 , 1 );
        temp.graphics.drawRect( 100,100,60,60 );
        temp.graphics.endFill();
        return temp;
    }
}

class CTest2 implements ITest{
    public function getSprite():Sprite{
        var temp:Sprite = new Sprite();
        temp.graphics.beginFill( 0xaadd77 , 1 );
        temp.graphics.drawCircle( 200,200,80 );
        temp.graphics.endFill();
        return temp;
    }
}