Remove clip and begin another clip by pressing button

At the end of a movie clip, I have a button.  The button has the following action script assigned to it:

on (release) {
      _root.unloadClip("BlueBall1hit");
      _root.attachMovie("PuttingValues", "PuttingValues_mc", 2);
}

I want to run the "PuttingValues" clip when the button is pressed.  This works for me by only using the second line of the script, however, I can still see the clip "BlueBall1hit" behind it.  So, I tried adding the first line of script to remove "BlueBall1hit".  This didn't work.

What script should I use so that only the "PuttingValues" clip is displayed?

Thanks in advance!
justkrissyAsked:
Who is Participating?
 
MontoyaProcess Improvement MgrCommented:
use unloadMovieClip or removeMovieClip instead. :)

0
 
justkrissyAuthor Commented:
I tried both:

on (release) {
     _root.unloadMovieClip("BlueBall1hit");
     _root.attachMovie("PuttingValues", "PuttingValues_mc", 2);
}

and:

on (release) {
     _root.removeMovieClip("BlueBall1hit");
     _root.attachMovie("PuttingValues", "PuttingValues_mc", 2);
}

and got the same results.  I can still see the first movie in the background.

Any other suggestion?  Or is it maybe because I'm using _root?  

Thanks!!
0
 
trigger-happyCommented:
on (release) {
     _root["BlueBall1hit"].unloadMovieClip();
     _root.attachMovie("PuttingValues", "PuttingValues_mc", 2);
}

and:

on (release) {
     _root["BlueBall1hit"].removeMovieClip();
     _root.attachMovie("PuttingValues", "PuttingValues_mc", 2);
}

--trigger-happy
0
 
Aneesh ChopraCommented:
Here is the solution:
just replace your code with the following:
-------------
on (release) {
     _root.BlueBall1hit.loadMovie("nothing");
     _root.attachMovie("PuttingValues", "PuttingValues_mc", 2);
}
------------------

Rgds
Aneesh
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.