4 Replies Latest reply on Feb 13, 2007 5:36 PM by Newsgroup_User

    Preloading question

    Level 7
      My preloader is acting up. It preloades, but the preload bar does not go
      all the way. Instead it stalls in the very end and then just goes into
      the file? You can see what I am talking about here:

      The preloader is in the file loading the other using the loader class
      like this:

      var mainL = this.createEmptyMovieClip("mainContent",
      mainL._x = 0;
      mainL._y = 0;
      mainL._alpha = 100;

      function attachTheLoadbar(){
      this.attachMovie("loadbar", "loadBar_mc",
      loadBar_mc._x = 340;
      loadBar_mc._y = 175;

      var movieloader_mcl:MovieClipLoader = new MovieClipLoader();
      var movieloader_mclListener:Object = new Object();

      movieloader_mclListener.onLoadStart = function(target:MovieClip):Void {
      movieloader_mclListener.onLoadProgress = function(target:MovieClip,
      numBytesLoaded:Number, numBytesTotal:Number):Void {
      loadBar_mc.theBar._width = (numBytesLoaded / numBytesTotal)*120;
      movieloader_mclListener.onLoadComplete = function(target:MovieClip,
      status:Number):Void {
      movieloader_mclListener.onLoadInit = function(target:MovieClip):Void{


      Thanks a lot for any help with this!
        • 1. Re: Preloading question
          Rothrock Level 5
          Looked fine to me. Do you have a lot of assets in the final frame(s) of your file? If that is the case the onProgress event won't be fired in the middle of loading that frame and so it will seem to hang and then once that frame is done it "jumps" to done. Or if you only have one frame, is there a lot of small things and then some one big asset?

          If it really bothers you – and from what I saw, I don't think it should – the only thing you can do is examine where your file size is coming from and try and even out the loading. Make something external, make something into two smaller assets, etc.

          Remember the purpose of the preloader isn't really to show an exact replications of a perfectly liner download experience. It is just to give your viewer and idea of what is going on and let them know the whole thing isn't just frozen.
          • 2. Re: Preloading question
            Level 7
            thank man!
            The files I am loading only have 1 frame, which has their content
            attached dynamically to them. I thought preloading them from the
            "outside" would get rid of the preloader hang up, but I guess it does
            not? I don't see how I could brake them up, but would it help if I put
            their content on the second frame? probably not, right...

            Thank you for the help!

            • 3. Re: Preloading question
              Rothrock Level 5
              Yeah I don't think there is much you can really do that would be worth the effort. It really looked fine to me.
              • 4. Re: Preloading question
                Level 7
                Thanks a lot for the help!