Okay I need a thorough explanation of how movie clips work…not actually creating them…but opening and closing them upon clicking. If I have movie clip 1 open and I click on movie clip 2 movie clip 2 opens on top of movie clip 1…how do I get movie clip 1 to close…is there more than way to accomplish this? What is the removeClip() function ? Thanks in advance.
No offence but this information is already available. Try reading yourself first.
Regards,
Viru.
Thanks for the in depth advice chief, but if I found what I was looking for I would’nt have posted here. Next? Or better yet how about some links then I can read for myself. No offense of course.
Got nothing better to do right now so i may aswell educate.
removeClip(); is a already existent method that is part of the actionScript programming lanuage. It used to ‘remove’ movie clips that have been attached to the movie via the attachMovieClip(); method. The point of its existence is to movie clips can be loaded into the swf when needed and disgarded when not needed.
You can think of movie clips as mini-swf’s. Just as a swf has a timeline (the main or root timeline), movie clips have their own timeline, which is independent from the main timeline.
So back to your question about opening and closing. There are several ways to do this. You can achieve the opening and closing effect by making the movie clips invisible or visible when required. Or (a more efficient method) you can use the attach and remove methods.
You just need to add the right actionScript to a button. For example something like:
on(release) {
_root.attachMovieClip(“movie1”);
}
That will place a movie clip, called movie1, onto the stage when the button is clicked.
Any further questions, just ask.
Regards,
Viru.
See educating isn’t so bad…even if you’re saying something you’ve sad a million times over…Anyways
on(release) {
_root.Story.play(2);
}
Is my curren’t script for opening my movie clips on stage…the problem is removing the clip that’s currently on stage in order to allow another to be opened so they don’t “sandwich” on to pof each other. So when I click on button 1 then click on button 2…a animation for button 1 closes it then opening button 2 and so on and so forth. Thanks in advance I’m not trying to be an “azz” but i’m getting frustrated.
Do you want to remove it completely as in not see it on the stage anymore? Or like stop playing it and moving it to the side out of the way kinda thing?
V.
I dont want it to be visible at all.
You can only use the remove method if you’ve used the attach method to get he movieclip in the first place, i think.
So add the following to a button:
_root.movieOne._visible = false;
That will make the movie clip movieOne invisible. If its on the root timeline and has an instance name of movieOne.
V.
So let me see if I’m getting this correctly I have
on(release) {
_root.Story.play(2);
}
on button 1
I add
on(release) {
_root.movie2.play(2);
_root.movieOne._visible = false;
}
And that will solve my problem?
What if I wanted to make it a little more advanced than that and have a closing animation, would that be that much more difficult?
Thanks for the help man
No its not difficult.
Lets say you want to make it fade out.
You can do it with action script or with tweening and less action script.
Assume this:
you have a movie clip called movieOne and movieTwo.
you have a button called aButton.
::movieOne::
Lets say you have your normal move content in the first 30 frames. Then on frame 31 Keyframe and put a another Keyframe say 20 frames along at frame 51. Create a tween so that is fades out.
And in the last frame add this following action:
this._visible = false;
::aButton::
To the button add the following action script:
on(release) {
_root.movieOne.gotoAndPlay(31);
_root.movieTwo.play();
}
Viru.
I think I can take it from here, thanks man…is there anyway I can contact you if I need any help? Just consider yourself a personal tutor
Haha, thanks.
You can email me using the email button at the bottom of my posts.
Viru.
One last thing with setting the visible of the mc’s to 0 I notice that sometimes it works and sometimes it doesnt…this is how I currently have it set up for a button…
on(release) {
_root.Cast.play(2);
_root.Cast._visible = true;
_root.Story._visible = false;
_root.Trailer._visible = false;
}
am I going about setting this up the wrong way?
on(release) {
_root.Cast._visible = true; // Put above, makes more logical sense.
_root.Cast.gotoAndPlay(2); // Should be this, not play(2) if your intending on going to frame 2 to start playing.
_root.Story._visible = false;
_root.Trailer._visible = false;
}
Looks good. In time you’ll be able to make functions that will let your write less code.
Thanks man it works beautifully I appreciate the help I really do. And I will be hitting up your email with questions on a regular basis ;).