Var

is there a way to remove all other clips, in stead of specifying whitch to remove?

Well… I think you can store all the names of movieclip to the array when you do the attachMovie() and keep the list in tact whenever you add/remove individual ones, and if you need to remove all of them, just make full loop in the array to get rid of them all…

As an alternative, you can put the whole thing into another movieclip and delte it if you want to… Like…
_root.holderMC.attachMovie(blah blah…
_root.holderMC.removeMovieClip();

Know what I mean???

after all the posts i made u should know that i dont know what u mean;)

Um… Okay… That ain’t funny… :beam:

Put this in the first frame of the main timeline…

_global.instanceArray = new Array()

and on all the place where you have this attachMovie() command, try this…


instanceName = "megani" + (_global.depth + 1);
_globa.instanceArray.push(instanceName);
var newMc = _root.attachMovie("megmain", instanceName, _global.depth++);

What I just did is to add the name of the instances you are creating to the array on the main timeline…

Now, to delete all of them,

for (i = 0 ; i < _global.instanceArray.length ; i++)
{
   _root[_global.instanceArray*].removeMovieClip();
}
_global.instanceArray = null;

I think this should work… At least you get the idea, right??? Let me know… :wink:

i tryeid it, not sure if i did it right, but now the moive freezes, and then crashes the player=(

u know what i could have done wrong? would u take a look if i posted it?

Crash??? :frowning:

Yes… Put it up and I’ll see what I can do…

thanks man, its on here now:
http://www.pro****.com/potofolio/pro6.fla

the **** is s_h_i_t (hope the admins can forgive my adress!=)

man, i got me a fever, **** im workin slow today

Well… I do not know the words in there, so I am not reall understanding it, but maybe you could tell me why you have this script under ‘megmain’??? Why are you letting Flash keep attach movieclips without user’s interaction, I mean button press???

instanceName = "kompetansemain"+(_global.depth+1);
_globa.instanceArray.push(instanceName);
var newMc = _root.attachMovie("kompetansemain", kompetansemain, _global.depth++);

instanceName = "portfoliomain"+(_global.depth+1);
_globa.instanceArray.push(instanceName);
var newMc = _root.attachMovie("portfoliomain", portfoliomain, _global.depth++);

i thought that i had to put it there, so its realy supposed to be on the buttons?

when uve had enouf of my **** joust tell me=)

Yes… I think that should go into the buttons… :wink:

Please do us all a favor and do not use foul languages… I don’t like to see ‘****’ when I read other people’s post… I don’t know how fun it is to you, but it is not to me… :frowning:

ill stop the fouls

ok, cool and i need to put one for eatch clip right, like i did?

Yes, please… :wink:

this is weird, i think i put it in the right places. but it still dont remove the old clips.

I put that code on the timeline where i want it to be removed.
ive posted the file on the net if u want to take a look

The same address with 1.7mb file again??? I’m on 56k… :frowning:

ok, thats not to cool then=) im dont wanna ruin u!

but heres what i did:

i put the

instanceName = “megani” + (_global.depth + 1);
_globa.instanceArray.push(instanceName);
var newMc = _root.attachMovie(“megmain”, instanceName, _global.depth++);

on the square buttons

and i put the

for (i = 0 ; i < _global.instanceArray.length ; i++)
{
_root[_global.instanceArray*].removeMovieClip();
}
_global.instanceArray = null;

on the timeline in the clips were i wanted to remove the other clips.

and i put this

_global.instanceArray = new Array()

on the first scene in the first frame

have i done something wrong here(probably=)

Okay… This is the part I don’t understand…

When is the time where you want to delete all those movieclip instances??? If it is a button, what is the name of the button???

thats supposed to be on a button to?

ok, now i put it on the button, and it looks like this

on (release) {
instanceName = “megmain” + (_global.depth + 1);
_globa.instanceArray.push(megmain);
var newMc = _root.attachMovie(“megmain”, megmain, _global.depth++);
newMc._x = 0;
newMc._y = 0;
}
on (release) {
for (i = 0 ; i < _global.instanceArray.length ; i++)
{
_root[_global.instanceArray*].removeMovieClip();
}
_global.instanceArray = null;

}

Um… I am not following you… I thought that you want to add the layer on top of each attached movieclips… and now you are saying that you want to remove them all at the same time???

but it dont work