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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing a movieclip with a button

Status
Not open for further replies.

silverswim

Programmer
Oct 17, 2001
50
GB
Hi,

I have attached a movieclip to the stage and put the code on the first frame of the root timeline. I want to remove the mc with a button, so in the actions of the button I put

on(rollOver){
_root.removeMovieClip("mcName");
}

then rolling out would attach the mc back again.

but the mc wont go... is this to do with having to use duplicate mc in order to remove it?

thanks in advance, silverswim
 
Post your complete code.
How are you attaching this movie clip exactly?
 
Hi oldnewbie,
here is what I have done:
on the first frame of the main timeline:

_root.attachMovie("logoAndText","logoAndText1",100);

_root.logoAndText1._x=75;
_root.logoAndText1._y=380;


then on a button on the stage:

on(rollOver){

_root.removeMovieClip("logoAndText1");

}

then there is this bit for rollOut, but the thing hasnt got to it yet...

on(rollOut){
_root.attachMovie("logoAndText","logoAndText1",100);

_root.logoAndText1._x=75;
_root.logoAndText1._y=380;
}


This code attaches the mc to the right place, but on the button rollover the mc wont go
silverswim

 
Try this line:

Code:
removeMovieClip(_root.logoAndText1);

instead of:

_root.removeMovieClip("logoAndText1");
 
Or...
Code:
on(rollOver){
    _root.logoAndText1.removeMovieClip();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top