5 Replies Latest reply on Nov 15, 2008 11:20 PM by Rothrock

    loadMovie levels

    matchley
      I have delved through ever loadMovie post here and still can't seem to find out how to get this to work.

      It is defiinitely a level issue, because when i put the instances of my menu buttons on the root timeline it works, but when the buttons are in the menu, which is a mc within a mc, it doesn't.

      I have tried what feels like every conceivable combination of _root _level0 _parent .....and it won't load!!! Download the fla file here.
      You will see some of the various combinations if you look at the fla file.

      Rothrock...if you read this. my apologies for not using movieClipLoader....but I understand that even less! I am a designer, trying to learn some coding.....

      thanks in advance for any help!!
      Mel
        • 1. Re: loadMovie levels
          Rothrock Level 5
          That is hilarious. And yes you really should use MovieClipLoader. Especially if you are a designer!

          First there is no way (at least correctly) to use loadMovie with levels. If you are actually using levels you need to use loadMovieNum().

          However _levels are a really bad idea and you should use them. They don't make a lot of sense. Since _level isn't a class there aren't a lot of things you can do with it.

          Movieclips are the dominant paradigm in Flash so creating empty movieclips and loading content into them is really the way to go.

          Other that I'm not really sure exactly what the problem is. Few of us here randomly download whole FLAs and sort through them. We generally expect the person who is asking for help to do a bit of "editing" as it were and point out the bits of code they are having trouble with.

          So what exactly are the problems you are having?
          • 2. Re: loadMovie levels
            Ned Murphy Adobe Community Professional & MVP
            There wasn't much to sort thru though. You're mistargeting the onRelease functions. The buttons don't live on the root level, but that's where you're trying to get their attention.
            • 3. Re: loadMovie levels
              matchley Level 1
              netwebs - i took the button code and moved it into the movies with the buttons (which makes total sense now that it has been pointed out to me) and it works perfectly.

              rothrock....if this is working:
              btn_01_02.onRelease = function(){
              loadMovie("home.swf", _root.loaderMC);
              }

              is there a good arguement about changing to MovieClipLoader? what would the benefit be?

              thanks for the quick responses!!
              mel
              • 4. Re: loadMovie levels
                Ned Murphy Adobe Community Professional & MVP
                You're welcome. MovieClipLoader will allow you to manage and keep track of the loading process. If the incoming swf file is very large you can manage a progress bar or some other loading status indication using some of its methods and events so that the user knows something is happening while they are waiting.

                Don't sweat using loadMovie if that's not the case... you will have made a good choice. Learn on!
                • 5. Re: loadMovie levels
                  Rothrock Level 5
                  The benefit would be the things that NedWebs suggested. But even more.

                  I can't tell you how many times we have all answer the question, "I'm loading external pictures and I want to set their size." Well you can't set the size until it is loaded. So you need a way to know when it is loaded.

                  Or perhaps you don't just want what you have loaded to blink onto the stage the moment it is loaded. Perhaps it should cross fade in with what is already there. Well you can't do that until it is loaded.

                  The number of things that you might want to do immediately upon the loading of something is pretty much endless.

                  Or perhaps the internet isn't quite working properly and you want to take care of the case where some external file doesn't load.

                  If you use loadMovie you have to make quite a bit of code to keep track of the loading. And there really isn't a good easy way to know if the file isn't loading properly and handling it.

                  The MovieClipLoader class has nice neat events onLoadInit, onLoadError, etc. that help you deal with these things much easier than the old school way.