• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

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!
0
justkrissy
Asked:
justkrissy
3 Solutions
 
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now