Array 함수를 이용해서 무비클립 복제와 Drag시키기 package { import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; public class BaseDocument extends MovieClip { private var arr:Array; public function BaseDocument():void { init(); } private function init():void{ arr = []; var len:int = 10; for ( var i:int = 0; i < len; i++ ) { var mc:Mc = new Mc(); mc.x = Math.random() * stage.stageWidth; mc.y = Math.random() .. 더보기 removeChild, removeEventListener를 통한 메모리상 객체지우기 package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.events.MouseEvent; import flash.display.MovieClip; public class RemoveChild extends Sprite { private var sprite:Sprite; public function RemoveChild() { init(); } private function init():void { sprite = new Sprite(); addChild(sprite); sprite.graphics.beginFill( 0xff0000); sprite.graphics.drawRect( 0, 0, 100, 1.. 더보기 키보드 제어 package { import flash.display.Sprite; import flash.events.KeyboardEvent; import flash.ui.Keyboard; public class KeyCodes extends Sprite { private var ball:Sprite; public function KeyCodes() { init(); } private function init():void { ball = new Sprite(); addChild(ball); ball.graphics.beginFill(0x000000); ball.graphics.drawCircle(0, 0, 40); ball.graphics.endFill(); ball.x = stage.stageWidth / 2; .. 더보기 이전 1 ··· 37 38 39 40 41 42 다음