dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: need help loading and unloading movies

  1. #1
    Junior Member
    Join Date
    Oct 2002
    Posts
    3

    need help loading and unloading movies

    i'm trying to discern which of the two commands (telltarget or loadmovie) is better at unloading/loading movies

    currently i have a set of buttons that links to movieclips. For example, h2O opens the movieclip h2Onav, pf3 opens movieclip pf3nav, and so forth. when clicked i want a movie loaded into the main movie. i've been able to accomplish this with telltarget, but the problem is, when clicking another button to load a different movie onto the stage, the movie clips loads on top of the existing one. how do i 'unload' the previous movie when loading another one?

  2. #2
    Child Prodigy Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    551
    Use this:
    Code:
        unloadMovieNum(0);
    Where '0' is the level that the movie is loaded into.


    gL,
    Furry
    Code:
      hobby = webDesign; waitYears(3);
      job = webDesign; this.love(job);

  3. #3
    on (release) {
    loadMovieNum ("pf3nav.swf", 0);
    }
    this will replace the first movie with a new one. Theres no need to unload a movie before sending a new one there Flash will automaticly replace the one thats at that level. Hope it helps, Ed

  4. #4
    Child Prodigy Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    551
    Cool! I didn't know that. Now I'm going to go tell that to another guy I'm trying to help with a similar problem.
    Code:
      hobby = webDesign; waitYears(3);
      job = webDesign; this.love(job);

  5. #5
    Junior Member
    Join Date
    Oct 2002
    Posts
    3
    thx airheaded, your script works but then i lose my main stage (buttons), its opens the .swf but it overwrites everything else, i actually want the movie embedded/loaded into the main stage

  6. #6
    Hi, Just replace the 0 with 1 or a higher level then send all your movies to that level. Flash will then leave your main .swf and just replace the movies you send to level 1. When you build a flash movie it is set at 0 by default. so if you use loadMovie and set the level at 0 it will replace the exsisting movie. So if you send a movie at level 1 it will just appear on top of the movie playing at level 0. Hope this sheds some light on this for you. Take care, Ed

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    It sounds like you want to use loadMovie, but you need to load the external movies into a target, not a level. Get the attachment below and look at the fla. There are two small swf's with it. Extract all to the same folder on your hard drive to work, then open the fla and test movie to make an swf of the main movie. The externals are just separate movies made to the same size as the target clip in the main movie. This helps in positioning later. The trick with the target clip is to open it to edit, then drag the top left corner to it's center point and leave it there, then go back to the main timeline and place the target where you want the other movies to show when loaded. You can load a hundred movies into the target, each succesive one, kicks out the previous movie, so there is no unload problems, or stacking.
    Attached Files Attached Files

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