We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Remove clip and begin another clip by pressing button

justkrissy
justkrissy asked
on
Medium Priority
200 Views
Last Modified: 2012-08-13
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!
Comment
Watch Question

Process Improvement Mgr
CERTIFIED EXPERT
Commented:
use unloadMovieClip or removeMovieClip instead. :)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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!!
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
CERTIFIED EXPERT
Top Expert 2008
Commented:
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
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*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.