removeMovieClip()

1)I was able to load an external .swf file into
a blank movie clip (A TARGET CLIP WHICH I CREATED using
createEmptyMovieClip)
2)Also by placing a button on the stage I was
able to remove the movie clip

BUT I WOULD LIKE TO BE ABLE TO KEEP ALL MY CODE IN THE FIRST FRAME. I would
like to Remove the Movie without putting the code on the button. But it
didn’t work.

Here is the code on the button that Does work

on (release) {
_root[“middle_mc”].removeMovieClip(); //middle_mc is my
target clip and
main01.swf is the external swf file //replace with any swf
you have in same
directory
}

This is the code on the first frame
[UNDERNEATH THAT IS MY ATTEMPT TO REPRODUCE THE CODE ON THE BUTTON]
I commented it out because I tried different ways to REPRODUCE WHAT HAD
ALREADY WORKED USING THE BUTTON!

this.createEmptyMovieClip(“middle_mc”, 1)
this.middle_mc._x=0;
this.middle_mc._y=0;
this.middle_mc.loadMovie(“main01.swf”); //use your own swf

// NOW FOR THE STUFF THAT DIDN’T WORK ON FRAME 1 - THERE ARE DIFFERENT VERSIONS OF MY ATTEMPTS UNDER EACH OTHER HERE
mybutton.onRelease.removeMovieClip._root(middle_mc);
//mybutton.onRelease.unloadMovie._root(middle_mc);
//mybutton.onRelease.unloadMovie._root[“middle_mc”, 1];
//mybutton.onRelease.MovieClip.onUnload._root(“middle_mc”);

Hopefully, the question is clear. I keep trying to be able to swap my code
from button to frame. I’d like to be clear as to how to do the same thing in
both ways.

I’d appreciate any help!
Mike
:sigh:

if you place your actionscript in a button or mc you use event handlers such as:

onClipEvent (load) {
onClipEvent (enterFrame) {
on (rollOver) {
on (rollOut) {
etc. etc.

to use the event handler from the timeline:

instanceName.onEnterFrame = function () {
instanceName.onLoad = function () {
instanceName.onRollOver = function () {
instanceName.onRollOut = function () {


this.createEmptyMovieClip ("middle_mc", 1)
this.middle_mc._x=0
this.middle_mc._y=0
this.middle_mc.loadMovie ("main01.swf")
mybutton.onRelease = function () {
	unloadMovie (middle_mc)
}

Thank you very much!

I knew it had to be a very short code, and yet everything I tried just didn’t work.

Much Appreciated!

Mike

no problem dude :slight_smile:

glad i could help :beam:

I am in the same situation, but my format is slightly different than that. Whenever i click a button, i want an swf to open in a movie clip(done this) should someone click on another button, how would i remove this one, and load the other one??:stunned: My buttons are all in a jumble. Anyone know how to explain this? Any help would be really great. =)