4 Replies Latest reply on Aug 3, 2006 8:23 AM by Tim Will Do It

    loadMovie & unloadMovie

    Tim Will Do It Level 1
      Hello.

      I'm running a Projector (.exe) file. At a certain frame, I am using loadMovie to load and run a Flash (.swf) file. This works great. But then, I want the loaded Flash file to unload the original Projector file. I do this because my Flash file is long, but I want my Projector file to be very short.

      If I understand what I'm doing, the Projector file is loading as _level0 and the Flash file is loading as _level1. So if I unloadMovie(0) from within my Flash file...shouldn't the Projector file unload, passing control over to the Flash file?

      If not, then does anyone have a suggestion for doing this? I tried using:

      FSCommand("exec", "filename");

      But that didn't give me what I was looking for either. Any other suggestions?
        • 1. Re: loadMovie & unloadMovie
          Darshan Rane Level 3
          if you want to close projector file that is .exe file u cant do it by unloadmovie.
          to unload a loaded swf use unloadmovie command.
          for closing projector file use close function or javasricpt in flash geturl to close projector file
          • 2. Re: loadMovie & unloadMovie
            Rothrock Level 5
            I didn't know you could use javascript with a projector file. What is going to handle the javascript calls – there is no browser?

            In any event Tim Will Do It, you are kind of missing the point of a projector file. The projector bundles the player and a swf together. If you close the projector, there will be no Flash player to continue playing your "external" swf.

            If your projector file is short – or even if it isn't – just stop its timeline and load your external file. It will run and "be in control." Whatever benefit you think you are trying to achieve is probably not necessary or needed. Possibly you need to redesign your project a little bit. What exactly are you looking for?

            Some folks do try loading their external clip into _level0. This does replace all the content at that _level, but it can also cause some problems. In general it is a good idea not to mess with _level0, just let it be.
            • 3. Re: loadMovie & unloadMovie
              Tim Will Do It Level 1
              In answer to your question about what I'm looking for, I'm starting the Projector file from a CD Autorun as a Preload type of file. That has to be a .exe because Autorun won't launch it otherwise.

              The .swf is being accessed from the Internet. That has to be a .swf because the computer will freak out if it sees I'm loading a .exe from the Internet.

              The reason I don't just create a shorter timeline in the Projector file is because I don't want it to close until the .swf has begun playing. That's way I wanted to close the Projector file from a command in the .swf file. If the Projector timeline is too short, then it may close before the .swf file has started playing. If it's too long, then it may still be open when the .swf file has started.

              That's why I want to be able to control when the Projector file closes based on when the Flash file starts. Is there a better way to do this?
              • 4. Re: loadMovie & unloadMovie
                Tim Will Do It Level 1
                Rothrock had the answer (in my particular case, anyway). Although he recommended against it, the suggestion of loading my presentation movie (the .swf Flash file) into _level0 did the trick. It replaced the Preloader movie(the .exe Projector file) and removed it from playing once the Projector movie started playing. It did the trick and gave me exactly what I was looking for. If this isn't the right way to achieve the goal stated above, please E-Mail me with a better suggestion. Thanks.