View Full Version : movieclip not disappearing

12-18-2008, 07:46 PM
Please help me

I am loading an external swf into my main movie as follows

mymovie.onLoad=function (){mymovie._visible=false;}

the instance name is mymovie... when the helloworld.swf loads i want the movieclip to become invisible.. but it is not working.... see the not working example here

why is the helloworld text still there?

12-18-2008, 08:16 PM
Why not removeMovieClip(this); ?

12-18-2008, 09:01 PM
I do not want the swf to be deleted ... does that function delete the movie or just make it invisible?

Update: tried it ...didnt work

12-18-2008, 09:32 PM
mymovie._alpha = 0;

This makes a movie clip invisible.

12-18-2008, 10:14 PM
i do not want the movie just to be invisible...i want it removed from the stage completely ... but i want to load it again later on ... that is why i loaded it in the first place ....

Update: I have attached my two fla files. They are not big, only 3 lines of code. Please help me find out why this is happening

12-18-2008, 10:46 PM
Ok, well it helps to be clear about your intentions.

You could always load the item and then hide it by using swapDepth() to place it underneath other movieclips or just use _y and _x to move it off the stage.

12-18-2008, 10:52 PM
Jeremy, Please, if you can, could you take a look at the files that i attached in my previous post . I do not want to solve this problem in another way without first knowing why it is not working just by making the movie clip _visible property to false. Here is an opportunity to learn something new :D

12-18-2008, 11:17 PM
Actually, your code shouldn't be working for several reasons.

1) Unless you failed to give us the code for "mymovie"'s creation, then "mymovie" doesn't exist. So loadMovie is trying to load your .swf into a null target.

2) Even if the .swf loads (which from your original post, it does), then just logically speaking, setting an onload handler after you load the movie doesn't make sense. As in every script, you need to set up the handlers before the events are fired.

3) I'm not 100% sure, but iirc you can't set an onload that way using the loadMovie function. If you want to set an onload handler, this is the correct way of doing it:

var mc_loader:MovieClipLoader = new MovieClipLoader();
var mc_listener:Object = new Object();
mc_listener.onLoadInit = function(target_mc)
target_mc._visible = false;


12-18-2008, 11:49 PM
hmm :eek: a lot to take in .. also i found out that when you do a loadmovie the instance name where you are loadin gthe swf to will be erased :( ....

thanks let me look into ...hmm where to start ...:confused:

12-19-2008, 02:19 AM
when you do a loadmovie the instance name where you are loadin gthe swf to will be erased
That's not true unless you overwrite it with a new target that has the same name.

12-19-2008, 02:39 AM
Please view the files that i attached for a demo that it is true

12-19-2008, 05:32 AM
Please view the files that i attached for a demo that it is true
I did and it's not true.

Here's your exact code in the fla:


First of all you didn't declare a the target before referencing it. Flash is being nice and assuming you want to create a new movie clip called "mymovie" - most languages aren't as lenient as AS2.

Secondly, if you check and see if mymovie is still around after you loadMovie it, it does in fact still exist: