3 Replies Latest reply on Mar 22, 2008 11:51 AM by matt_stripe77

    My preloader is not working! can u help?

    matt_stripe77 Level 1
      please look at this code and tell me if anything is wrong with it,,, basically when it loads my main swf the preloader text and image do not dissapear. If you can help that would be great

      var myMCL:MovieClipLoader = new MovieClipLoader();
      var myListener:Object = new Object();

      myMCL.addListener(myListener);

      myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
      var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
      progressBar.gotoAndStop(loaded);
      }

      myListener.onLoadInit = function (target_mc:MovieClip) {
      progressBar._visible = false;
      }

      myListener.onLoadStart = function (target_mc:MovieClip) {
      progressBar._visible = true;
      }
      myMCL.loadClip('ub_web.swf','container');


      thanks
      Matt
        • 1. Re: My preloader is not working! can u help?
          funkysoul Level 4
          If I understood it right you just need to add this to your onLoadProgress function:
          progressBar._visible = false;
          • 2. Re: My preloader is not working! can u help?
            matt_stripe77 Level 1
            Hi Tiago
            thanks,, I have added as you said that extra bit of code right after the on load function, however I still have the
            same problem. Is the highlighted code in the right place?

            var myMCL:MovieClipLoader = new MovieClipLoader();
            var myListener:Object = new Object();

            myMCL.addListener(myListener);

            myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
            var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
            progressBar.gotoAndStop(loaded);
            progressBar._visible = false;
            }

            myListener.onLoadInit = function (target_mc:MovieClip) {
            progressBar._visible = false;
            }

            myListener.onLoadStart = function (target_mc:MovieClip) {
            progressBar._visible = true;
            }
            myMCL.loadClip('ub_web.swf','container'); Text Text Text progressBar._visible = false; Text
            • 3. Re: My preloader is not working! can u help?
              matt_stripe77 Level 1
              Hi Tiago
              thanks,, I have added as you said that extra bit of code right after the on load function, however I still have the
              same problem. Is the progressBar._visible = false; code in the right place?

              var myMCL:MovieClipLoader = new MovieClipLoader();
              var myListener:Object = new Object();

              myMCL.addListener(myListener);

              myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
              var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
              progressBar.gotoAndStop(loaded);
              progressBar._visible = false;
              }

              myListener.onLoadInit = function (target_mc:MovieClip) {
              progressBar._visible = false;
              }

              myListener.onLoadStart = function (target_mc:MovieClip) {
              progressBar._visible = true;
              }
              myMCL.loadClip('ub_web.swf','container');