Clearing everything and re-loading

Hey there, I’m making a gallery, with seperate xml pages for each set of images.

In a simplistic view, what I want to do is when the ‘previous’ or ‘next’ button is pressed, increase or decrease the page number by 1, which is easy enough, and start afresh…

I though it should be a case of removing all the children from the scene and then executing the functions at the start of the script, after all the variables have been set.

However, when I do this, I get the following error:

[Tweener] Error: : [object preloaderMain_12] raised an error while executing the’onComplete’handler.

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()

Any ideas?