Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-18-2004, 04:42 AM   #1
vicci
Registered User
 
Join Date: May 2004
Posts: 16
Default RemoveMovieClip trouble

Hi all !

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]);
}



Any idea ? Thx a lot
vicci is offline   Reply With Quote
Old 05-18-2004, 04:55 PM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

try:
on(press){
_root.MC1.MC2["test"+i].removeMovieClip();
}

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?
tg is offline   Reply With Quote
Old 05-21-2004, 05:23 AM   #3
vicci
Registered User
 
Join Date: May 2004
Posts: 16
Default

thx tj for the answer.
I have find the solution, i have just forgotten to put my loop:

So the good as is :

on(press){
for (var=i;i<noeuds.length;i++){
removeMovieClip(_root.MC_1.MC2["test"+i];
}
vicci is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:51 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.