flash on 2009-9-20

by TmskSt
♥0 | Line 31 | Modified 2009-09-20 10:32:55 | MIT License
play

ActionScript3 source code

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

package {
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	public class FlashTest extends Sprite {
		private var s:Sprite = new Sprite();
		private var h:Hoge;
		public function FlashTest() {
			stage.addChild(s);
			h = new Hoge(this.stage);
			h.c();
		}
	}
}

import flash.display.Stage;
import flash.display.Sprite;
class Hoge {
	private var _stage:Stage;
        private var s:Sprite;
	public function Hoge(stage:Stage) {
		this._stage = stage;
                this._stage.addChild(s = new Sprite() as Sprite);
		s.graphics.beginFill(0x00ff00)
		s.graphics.drawCircle(0, 0, 100);
		_stage.addChild(s);
	}
	public function c():void {
		s.graphics.beginFill(0xffff00)
		s.graphics.drawCircle(0, 0, 50);
		_stage.addChild(s);
	}
}