0

わかりましたので、次のコードがあります...

function fire1(e:MouseEvent)
{
    firebb.addChild(fireb);
    fireb.x=firebb.x;
    fireb.y=firebb.y;
    fireb.parent.setChildIndex(fireb, numChildren-1);
    fireb.startDrag();
    pop.play();
}

それがすべきことは、firebb Movieclip の子を作成し、その深さを変更することです (すべての上にあるはずのカスタム カーソルを使用します...しかし、ゲームがこのポイントに達すると、このエラーが発生します。

RangeError: Error #2006: The supplied index is out of bounds.
    at flash.display::DisplayObjectContainer/setChildIndex()
    at main_fla::MainTimeline/fire1()

setChildIndex は以前のフレームでは問題なく機能していましたが、何が問題なのですか?

4

1 に答える 1

1
fireb.parent.addChild(firWb);

また

fireb.parent.numberChildren -1
于 2012-12-03T00:52:11.823 に答える