I have an XML document that I am reading in and drawing a bunch of rectangles from the data that I get. This bit of code is inserted in one frame. Buttons are used to navigate through the frames. A button on the main screen takes you to the frame that draws the rectangles. I have a Back button on the frame that draws the rectangles that takes you back to the main screen and that works fine but when I click Back, the rectangles that I drew still remain on the scene. Is there anyway that I can erase all of the rectangles at once?
Thanks
Define an array of type DisplayObject and add each object (Sprite, Movieclip) to it.
When you want to remove them, iterate through the array and remove the child: