10 Replies Latest reply on Mar 4, 2007 2:59 AM by Sketchsta

    MovieClipLoader

    jl2000 Level 1
      Hi - In over my head (as usual) but here goes...
      I have a master.swf that will be the container and background for other swfs....most notably the "splash.swf" . Splash is the container for all the navigation (external text files loaded into dynamic text boxes) - so its important that it be completely ready before appearing.

      In master I have the code below - using MovieClipLoader, loading splash into holder_mc. The problem is that when splash appears, it has a jerky, staggering appearance instead of the smooth movements it should. The onLoadProgress counter tells me that splash is appearing around 90%.

      What am I doing wrong here?

      TIA any suggestions.

      JL
        • 1. MovieClipLoader
          Sketchsta Level 1
          try:

          //create a listener object
          var listener_mc:Object = new Object();

          //tell listener_mc what to do.
          listener_mc.onLoadInit = function (target_mc:MovieClip) {
          target_mc.play();
          }
          listener_mc.onLoadStart = function (target_mc:MovieClip) {
          target_mc.stop();
          }


          hope that helps.
          • 2. Re: MovieClipLoader
            jl2000 Level 1
            Sketchsta -

            Thanks for the code. I need to double check with you that I've used it correctly - so it's attached.

            Splash is loading up as before but that onLoadProgress function isn't showing up now. So I can't get whether the entire splash is loading.

            When you use the phrase "target_mc" - am I supposed to replace that with my phrase "zloader" or "holder_mc" ?

            I appreciate your expert input.

            JL
            • 3. MovieClipLoader
              Sketchsta Level 1
              Hi, yeah you done it right, but you forgot to add listener_mc to your movieClipLoader.

              zloader.addListener(listener_mc);

              as for target_mc, you dont need to change it to the file you are loading. By specifying target_mc, Flash automatically knows you are reffering to the clip thats being loaded.

              also in your code where you create a movieClip, you have...
              this.createEmptyMovieClip("holder_mc", getNextHighestDepth);

              im not too sure if that will work as instructed. you forgot the open and close brackets after getNextHighestDepth.
              should be..
              this.createEmptyMovieClip("holder_mc", getNextHighestDepth());

              i might be wrong, and it works without the brackets...but i havent tried, so i cant be sure..

              anyway, once you add the listener, you should have no problems.
              let me know how it goes.
              • 4. Re: MovieClipLoader
                jl2000 Level 1
                Sketchsta -
                Thanks again. I made the changes you suggeted and still wasn't getting any progress indicator but based on your input I was able to "intelligently" do some digging, found some Help file code, and got what I wanted by starting over. Thanks for the tip.
                JL
                • 5. Re: MovieClipLoader
                  jl2000 Level 1
                  Sketchsta - I hope you're still with me.

                  That code wound up biting me when I went to bring another swf into splash using another "EmptyMovieClip" . It just wouldn't do it unless I modified the code on master that brought splash in. I eventually figured out not to create an empty and used the attached code.

                  But now - sometimes splash appears without the navigation text! Doesn't that mean that, after all this, splash is NOT being preloaded? If it was, wouldn't it's components (accordion with mc's in it) , and text files (inside those accordion mc's) and other decorative mc's also preload? This is extremely annoying because the entire splash swf is USELESS without the text being displayed.

                  Can anyone please set me straight on this?

                  JL


                  • 6. MovieClipLoader
                    Sketchsta Level 1
                    hey jlucchesi, yeah im still with you. just really busy at the moment.
                    ive modified your code abit here, it works good on my end... see how it works for you...

                    this code...
                    * will NOT play the loaded clip until loading has finished
                    * a dynamic text field will display the amount loaded, and dissapear once the loading is 100%
                    * you can use the same dynamic Text field for other loading, simply set it's _visible property to true onLoadStart()

                    let me know how you go with it.


                    • 7. Re: MovieClipLoader
                      jl2000 Level 1
                      Thanks Sketchsta -
                      I appreciate your help and your time.
                      All the best.
                      JL
                      • 8. Re: MovieClipLoader
                        Sketchsta Level 1
                        Not a problem. =)

                        hope it's what you needed.
                        • 9. Re: MovieClipLoader
                          jonasal
                          Sorry for piggy backing on here but I just ran that code and it works fine locally but when I put in on my server the file only loads about 7 % and stops

                          any ideas what might be causing this
                          • 10. MovieClipLoader
                            Sketchsta Level 1
                            thats ok, we all need help every now and then. =)

                            maybe at 7% theres a bigger chunk of data to load, so it might take a second or two to load it... wait it out..
                            if it's not moving after say 10seconds MAX... then there is something wrong..

                            but if it works locally it should work just fine on a server too.

                            *is it possible some of your other code is interfeering??
                            *did you edit the code in any way?

                            if you did, post it up, and we'll take a look.