Flashmx - removing multiple movieclips


I have this…

menuXml.onLoad = function() {
menuItem = this.firstChild.childNodes;
for (var i=0; i<menuItem.length; i++) {
item = _root.attachMovie(“itemClip”, “itemClip” + i, i);
item._x = 208;
item._y = 70 +50i;
item.itemDate.text = menuItem
item.itemAdd1.text = menuItem*.attributes.add1;
item.itemAdd2.text = menuItem*.attributes.add2;
item.itemTime.text = menuItem*.attributes.time;

it creates as many movieclips as needed by the above XML…

I want to be able to remove all the created clips, when i nav off that page…


this on release, removes one movieclip, from the bottom, but the others remain.

any suggestions?
much appreciated.

then you would need another for loop just like the one above to go through and remove each clip individually (_root[“itemClip”+i].removeMovieClip();).

An alternative would be to create a single empty movieclip for all of those attached movieclips to live in. Then, to get rid of all those clips, just remove that one clip in which they all exist. That will take care of it without the loop.

too easy! thanks senocular! nearly lost my brain over this!

on (release){
for (var i=0; i<menuItem.length; i++) {
Many thanks

welcome :pleased:

oh senocular, i love your ASDRecorder class!!
Ive been admiring these things for a long time, wondering if ill ever have time to do my own. I bought a friends of ed book - advance flash for php, especially for the article on ming - drawing guestbook, only to find my server doesnt support it :frowning: and they wont, the gits until lots of ppl demand it… yeah like thats going to happen!

Im not worthy to share the same window as thou :smiley:

oh thats cool. Ming has always been promising but the fact that I dont have access to it (that I know of heh) means that it doesn’t do much good. I always try to shoot for the lowest common denominator hense the simple text format of the ASDRecorder class. That may actually be revised as well to make way for another old project I might bring out of the closet. We’ll see how that goes. :wink:

oh id pay money for a working example! :slight_smile: