5 Replies Latest reply on Jul 22, 2006 6:02 AM by Rothrock

    loadMovie() vs. loadClip  HELP

      So here is what I want to do...

      if ( load success ) {
      do something
      else if (load fails) {
      do something else

      Anyway, thats an oversimplified version of what I'd like to do, but from what I read I suppose I need a listener, which is only found in loadClip(); ? I have no idea how to actually execute this properly. Anybody lend a hand?
        • 1. Re: loadMovie() vs. loadClip  HELP
          Rothrock Level 5
          For somebody with "help" in your screen name, I bet you can guess what the answer is going to be: Look in the Help files.

          loadClip is a method of the MovieClipLoader class which was introduced with Flash MX04. So if you are publishing for that or newer you will be able to use the MovieClipLoader class. Check the help files. Copy the code from the help files and you are good to go.

          There are several events for the MovieClipLoader class that will help you with what you want to do. In general onLoadInit should be used instead of onLoadComplete.

          If you aren't using MX04 or later you will have your work cut out for you. The basic old-school preloader can do the first part of your conditional, but there is no easy way to do the second part.

          If that is what you need, post back and I'll go into more detail.
          • 2. Re: loadMovie() vs. loadClip  HELP
            Mr._Helpy_McHelpson Level 1
            yeah, I know where the help files are. The name is from Happy Gilmore, albeit not the greatest name to ask a question with I spose ;)

            Anyway, I've been reading through the help files, and been unable to actually transfer the words to relevent thoughts: call it ADD, or just inability to comprehend the MovieClipLoader class. Anyway, I thought I'd post here hoping somebody could lend a few simple words to help me make that transition. But I guess I can just stare at the help files more.

            I am using MX04. I've written this with loadMovie using logic loops, and probably more code than necessary, but I'd like to take advantage of the previously mentioned class.
            • 3. Re: loadMovie() vs. loadClip  HELP
              Rothrock Level 5
              I could go to the help file and copy the examples, but I think you can copy that yourself just as well.

              Are you using Flash 8? Don't use search or anything like that. Start with a brand new completely empty flash file, open your Actionscript window and just type the word onLoadInit on a line by itself, put the cursor in the word and press F1. This will take you directly to the entry for that event.

              Copy the code from the bottom of the entry (there are two examples, but I suggest just taking the last one) and paste it into your actionscript window. Be sure to get rid of the onLoadInit you typed earlier.

              Now do the same thing for the onLoadError. In that case you only need the part that starts loadListener.onLoadError and goes down to the first/closing curly brace. Put that into your actionscript window.

              There you go! You may need to change some little bits to make the names work with what you have.
              • 4. Re: loadMovie() vs. loadClip  HELP
                This thread was very informative. Now I'm wondering if there is still any advantage to using loadMovie in any particular situation? Or is it obsolete, more or less? Thanks, all!
                • 5. Re: loadMovie() vs. loadClip  HELP
                  Rothrock Level 5
                  If you are publishing for Flash 6 or earlier then you need to use it. Otherwise I don't see any reason to use it. Even so, I do see learning to use loadMovie and making an old-school preloader as a very valuable learning tool for understanding how Flash works.

                  If I ran the world (hey, it could happen!) I would make everybody learn this first and then be, "But wait, now that you have hurt your brain with that, here is the easy way!"

                  Good luckl