Unloading a child movie

Hi all,

The first movie is “Home.swf” and I loaded another movie called “childOne.swf” in to the home.swf by this command _root.holder.loadMovie(“childOne.swf”);, it works fine.

But i need to remove the “childOne.swf” , when clicked on that … How ?

i tried with this "removeMovieClip(“childOne.swf”) But its giving error…

Plz help me …

you could bump it out by loading another movie to take it’s place, a blank one if that’s what you want

You can do it this way as well, but it requires that you create an empty movieclip to load your external movie. Try something like this:[AS]_root.createEmptyMovieClip(“emptyMC”, 2);
_root.emptyMC.loadMovie(“childOne.swf”);
_root.emptyMC._x = 145;
_root.emptyMC._y = 120;[/AS]
You can also specify where you want that newly created movie clip to be on the x and y cordinates.

To unload it you would now use this:[AS]_root.emptyMC.removeMovieClip();
[/AS]
removeMovieClip will only unload movie clips that are created with createEmptyMovieClip or attachMovieClip.

Hi Friends,

Thanks very much.
It works great…!!

For loading…>>
_root.createEmptyMovieClip(“emptyMC”, 2);
_root.emptyMC.loadMovie(“subOne.swf”);
_root.emptyMC._x = 0;
_root.emptyMC._y = 0;

… AND…

and for UNnloading…>>

_root.emptyMC.removeMovieClip();

Thanks : i am only 6 month aged [flash]

:slight_smile: :slight_smile:

You’re welcome, I’m glad it worked for you. Also, welcome to the forum. =)