dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Movie loading behind another? help!?

Hybrid View

  1. #1
    Member
    Join Date
    Jun 2003
    Posts
    41

    Movie loading behind another? help!?

    Hey.

    attahced to a button i am trying to make a seperate .swf file load into an instance on the stage, replacing the exisitng one, however, it seems that the new .swf file is loading but behind the one that is already there.

    I have tried putting an unloadMovie action before the laodmovie on the button but that doesnt seem to work either?

    any suggestions, the file is here - the button the script is attached to is the 'About Us' button,

    http://www.fashionmarketinguk.com/1.fla

    thanks

    jonny

  2. #2
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    You should post a .zip with ALL the files (the FLA plus the SWF files to be loaded).

    Cheers!
    Altruism does not exist. Sustainability must be made profitable.

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Can't open your .fla, because you're either on Mac (.fla needs to be zipped up!) or you're on MX2004, and you should save a copy of it in MX only format.

    That said, if you load a new movie in the exact same container clip or level, then the new movie should automarically replace the previous one.

  4. #4
    Junior Member
    Join Date
    Oct 2003
    Posts
    20
    Can you please let me know if you found a solution to this problem? I have been experiencing a similar problem - ie click on a button to load my swf, but the original menumovie stays behind - the menumovie is invisible, but all the buttons are active (invisible) links...?

    Here is my code on the button - I'd really appreciate your advice?
    thanks

    on (release) {
    _root.createEmptyMovieClip("container", 1);
    loadMovie("mol.swf", "container");
    container._x = 0 ;
    container._y = 0 ;
    }

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    What's the problem? The menu is invisible or that it can still be clicked?

  6. #6
    Junior Member
    Join Date
    Oct 2003
    Posts
    20
    The problem is that the links can still be clicked...

    They belong to the mainmenu.swf and the container in this file should load a new .swf movie over the top. The new .swf if loading in ok, but with the links from the mainmenu still clickable.

    appreciate your help.

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You'll have to disabled them, while the other movie is displayed.
    Several ways to do it...

    The easiest, and it would be easier if your buttons were numbered named (i.e kind of like button1, button2, etc...) because you could then use a for loop to disable all of them, and re-enabled them when you get rid of the other movie, is simply to disable all your buttons when loading your movie...
    code:

    on (release) {
    _root.createEmptyMovieClip("container", 1);
    container._x = 0;
    container._y = 0;
    loadMovie("mol.swf", "container");
    _level0.my_button1.enabled = false;
    _level0.my_button2.enabled = false;

    // Etc...
    }



    Of course your buttons have to have instances names so you can refer to them in the above manner.
    When you get rid of your movie and want to re-activate your buttons, use...
    Code:
    ...
    _level0.my_button1.enabled = true;
    _level0.my_button2.enabled = true;
    // Etc...

  8. #8
    Junior Member
    Join Date
    Oct 2003
    Posts
    20
    thanks very much, I'll give that a try.

    I was just now working on another way - though less clever than yours.
    I've set up a frame in my mainmenu called "load" which has a stop action in it and no other buttons.

    Then this script on the button on frame 1 of mainmenu creates the container into the "load" frame, so there are no other links.

    on (release) {
    gotoAndPlay("load");
    _root.createEmptyMovieClip("container", 1);
    loadMovie("mol.swf", "container");
    container._x = 0;
    container._y = 0;
    }

    When I unload the movie, I send it back to the first keyframe - seems to work okay even if slightly clunky.

    I thought that when you create a new container and load a movie into it, that it was supposed to sit on top of the first movie - I'm surprised that I needed to find a workaround...? Hasn't anyone else come across this before?

    thanks again

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Well that was one other "of the severals ways" I mentioned above.

    The new movie does sit over the main one, but that doesn't de-activate underlying content.

    The method you used was one of the only possibilities up to Flash 5, since you couldn't give instance names to buttons before MX. That still would be the only better possibility, if you were publishing for Flash 5 player compatibility, since my proposal wouldn't work.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center