Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts

    movieclip not disappearing

    Please help me

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


    Code:
    loadMovie("helloworld.swf","mymovie");
    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
    http://www.skenglish.sk/deleteme/mainmovie.swf

    why is the helloworld text still there?

  • #2
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    Why not removeMovieClip(this); ?
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • #3
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by gani; 12-18-2008 at 09:04 PM.

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Code:
    mymovie._alpha = 0;
    This makes a movie clip invisible.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #5
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Attached Files Attached Files
    Last edited by gani; 12-18-2008 at 10:50 PM.

  • #6
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #7
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #8
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    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:
    Code:
    var mc_loader:MovieClipLoader = new MovieClipLoader();
    var mc_listener:Object = new Object();
    mc_listener.onLoadInit = function(target_mc)
    	{
    	target_mc._visible = false;
    	}
    mc_loader.addListener(mc_listener);
    
    _root.createEmptyMovieClip("my_movie",_root.getNextHighestDepth());
    mc_loader.loadClip("helloworld.swf",my_movie);
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • #9
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm 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 ...

  • #10
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    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.
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • #11
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please view the files that i attached for a demo that it is true

  • #12
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    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:
    Code:
    loadMovie("helloworld.swf",mymovie);
    _root.mymovie._visible=false;
    stop();
    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:
    Code:
    loadMovie("helloworld.swf",mymovie);
    _root.mymovie._visible=false;
    stop();
    trace(mymovie);
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •