I have a small trouble with a removeMovieClip function:
Iam trying to remove attached MC by clicking on a button but it dont function. The MC are attached dynamiqly thanks to xml and they are attached to an other Mc. I have tried with SwapDepth but nothing better.
here the as to attached my mc:
noeuds = this.firstChild.childNodes;
for (var i = 0; i<noeuds.length; i++) {
link = _root.MC1.MC2.attachMovie(noeuds[i].attributes.ico, "test"+i, i);
link.ico = noeuds[i].attributes.ico;
"link" is a variable which unable me to set property to the mc attached.
"_root.MC1.MC2" its the MC which i attach my other mcs ""test"+i" ;
here the as to remove my mc:
on (press) {
unloadMovie(_root.MC1.MC2["test"+i]);
}
but there is a 'gotcha' with this code, unless you're tracking 'i' somewhere else, 'i' will of course have the value of noeuds.length, so flash won't find the correct movieclip to remove.
__________________
tg
---
what the hell was i thinking?