블로그 이미지
플래시로 밥먹고 살고 있습니다... 하지만 여긴 플래시 전문 블로그가 아닌 그냥 개인 블로그랍니다
미나토

Recent Comment

calendar

      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
  • 56,002total
  • 9today
  • 173yesterday
2007/06/04 11:01 Flash Platform

var sp1:Sprite = new Sprite();
addChild(sp1);
var sp2:Sprite = new Sprite();
addChild(sp2);
sp2.y = 400

var shape:Shape = new Shape();
shape.graphics.beginFill(0xFFFF00);
shape.graphics.drawCircle(0, 0, 200);

sp1.addChild(shape);
sp2.addChild(shape);


두개의 DisplayObject 클래스를 화면에 올려놓고 또하나의 DisplayObject  클래스를 만들어 집어넣어보았다.

그냥 단순한 생각으로는 두군데 모두 들어가야 맞다고 생각했으나 그게 아니었다. DisplayObject 클래스에는 clone 메소드도 없으니 결국 new 로 새 DisplayObject 를 생성해야 한다.

sp1 과 sp2에서 shape 를 참조하는게 아니라 shape 에서 자신이 addChild 된 DisplayObject 클래스를 찾는 것일까?


생각해 볼 문제다.
크리에이티브 커먼즈 라이선스
Creative Commons License
posted by 미나토