Reputation: 171
OK so I have the following code...
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();
}
what it's supposed to do, is create a child of the firebb Movieclip and change its depth (I use a custom cursor which is supposed to be on top of everything...but then I get this error when my game reaches this point.
RangeError: Error #2006: The supplied index is out of bounds.
at flash.display::DisplayObjectContainer/setChildIndex()
at main_fla::MainTimeline/fire1()
setChildIndex worked flawlessly in previous frames, what's wrong now?
Upvotes: 0
Views: 725