Crazy about ActionScript or Something!

ArgumentError: Error #2025: 指定した DisplayObject は呼び出し元の子でなければなりません。

呼び出し元に指定したDisplayObjectがついていない場合に起こる。

発生例

var sp:Sprite = new Sprite();

var sh:Shape = new Shape();
sh.graphics.beginFill(0xFF0000);
sh.graphics.drawRect(0, 0, 100, 100);
sh.graphics.endFill();
addChild(sh);

sp.removeChild(sh);

shはstageにaddChildされているが、spにaddChildされているものと勘違いしてremoveChildしようとした。

0 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Comments links could be nofollow free.

(c) 2010 chimanaco blog | powered by WordPress with Barecity