We help IT Professionals succeed at work.

Actionscript RemoveMovieClip Issue

406 Views
Last Modified: 2008-02-01
Hi All,

I've attached some movieclips, and need to remove them before attaching more. The only success I've had is with the two lines that are commented out in the actionscript below  (ie where I delete them by name). As there are quite a few I have tried to generate the names through a loop, and then put that name into a delete satement, but its not working. Can anyone tell me what I'm doing wrong or give me an alternative method please .... ???

            for (u = 0; u < 50; u++) {
            
            delname = "content_mc.client_list_mc.august"+u+"_mc";
            trace("delname "+delname);
            delname.removeMovieClip();
            //content_mc.client_list_mc.august1_mc.removeMovieClip();
            //content_mc.client_list_mc.august2_mc.removeMovieClip();
      
            }
Comment
Watch Question

Antonio EstradaEngineering Manager / Architect
CERTIFIED EXPERT

Commented:
Try

for(u=0;u<50;u++) {
   delname = "content_mc.client_list_mc.august"+u+"_mc";
   unloadMovie(delname);
}

Good Luck.

-V

Author

Commented:
Hi Vulturous , thx for the quick reply there.

Do you know if its possible to find the number of movieclips attached, and to loop through them with something like :

number_of_movies = content_mc.client_list_mc.length;

for(u=0;u<number_of_movies;u++) {
   delname = content_mc.client_list_mc.[u];
   unloadMovie(delname);
}

i'm not sure how in actionscript...

Engineering Manager / Architect
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.