View Full Version : closing a movie clip
happyguy142
06-21-2006, 08:24 PM
Hey everybody, I was wondering if anyone would know how I can make a button that closes a movie clip. The project is very simple at the moment, it's just a button that when you roll the mouse over it it plays a movie clip that is just a square that fades in and has some text fade in. I want to have a button that is placed on the movie clip it self that closes it
Let me know if you can help me!
anticonnor
06-21-2006, 09:53 PM
Well, you can either set your clips _visible to false when you release your button. Or, if you actually want to remove it completely, you should attach your clip to the stage dynamically, and use removeMovieClip to remove it:
this.attachMovie("my_clip", "my_clip01", 10, {_x:100, _y:100});
this.my_but.onRelease = function(){
my_clip01.removeMovieClip();
};
stop();
Just slap that code onto the first frame that you want your clip to appear, and change the my_but and my_clip names to whatever you want.
happyguy142
06-22-2006, 01:37 AM
thank you very much, I will try that when I get the chance
anticonnor
06-22-2006, 01:40 AM
Oh, yeah... you need to give your MC a linkage ID in your library. Just right click your mc in the library and select linkage, then check export for actionscript and give it a name like my_clip.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.