Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the removeMovieClip command 1

Status
Not open for further replies.

ticke

Technical User
Joined
May 1, 2003
Messages
65
Location
US
Basically I have a button, a blank movieclip and a movieclip inside the library linked with identifier "test".

I got it to attached to the blank movieclip just fine, but how do i get it off the main stage using another button?

Thanks in advance.
 
button1.onRelease = function(){
clip.attachMovie("test","test1",1);
}
button2.onRelease = function(){
clip.unloadMovie();
}
 
Assuming you have something like this...

on (release) {
_root.blank_mc.attachMovie("test","newtest",10);
}

To remove it...

on (release) {
_root.blank_mc.newtest.removeMovieClip();
}




Regards,

cubalibre2.gif
 
It seems to be working perfectly, thank you.

One other question if you don't mind. Since I am not a programmer, I have another bump in the road if that's what you want to call it.


Basically, the example shows only 3 buttons but I planned to have a lot more.

With the attach/remove mc, I basically have to check and remove all the attached movie before attaching the right one on a particular button. Is there an easier way to do it beside:

_root.blank1.newmovie1.removeMovieClip();
_root.blank2.newmovie2.removeMovieClip();
_root.blank3.newmovie3.removeMovieClip();
_root.blank4.newmovie4.removeMovieClip();

and so fourth. If I have 50 buttons, that could pose a problem.

Thank you again...
 
looks to me like the same movie clip for each button so why not just give it an instance name and call it from the on release function

better still if its for all buttons

Button.prototype.OnMouseDown = function(){
arrow_clip.play();
}

that will leave the on release, on press, for the button actions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top