3 Replies Latest reply on Sep 15, 2006 1:47 PM by Newsgroup_User

    Preloading

    aaron17
      I have a project I'm working on and it uses a main swf and links to other swfs to display, but some are a bit large (3-400K ish) and need a preloader. Well I made a preloader and it works fine with the swfs that don't have a scrollable pane, but for some reason it won't work if they have a scroll pane. Any ideas to why this would happen or a work around?

      Here's the code I'm using:
      lBytes = _root.getBytesLoaded();
      tBytes = _root.getBytesTotal();

      percentLoaded = Math.floor((lBytes/tBytes)*100);
      loader.bar._xscale = percentLoaded;
      loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) + "K loaded.";

      if (lBytes>=tBytes && tBytes>0){
      if (count>=12){
      gotoAndStop("main");
      }else{
      count++;
      gotoAndPlay("preload");
      }
      }else{
      gotoAndPlay("preload");
      }
        • 1. Re: Preloading
          Level 7
          >Well I made a preloader and it works fine with the swfs that don't have a
          >scrollable pane, but for some reason it won't work if they have a scroll
          >pane.

          What exactly do you mean? Is it jumping to some odd number or percentage
          such as 50%? If so, take the scroll pane off the stage, and in the library,
          right click the scroll pane, select linkage, then select the first check box
          "Export for Action Script", then UNCHECK "Export in first frame", then place
          the scroll pane back on the stage.

          Either that or go to publish window, click on settings, and type in a number
          higher than where your preloader resides.

          Ryan

          "aaron17" <webforumsuser@macromedia.com> wrote in message
          news:eecd6u$f32$1@forums.macromedia.com...
          >I have a project I'm working on and it uses a main swf and links to other
          >swfs
          > to display, but some are a bit large (3-400K ish) and need a preloader.
          > Well I
          > made a preloader and it works fine with the swfs that don't have a
          > scrollable
          > pane, but for some reason it won't work if they have a scroll pane. Any
          > ideas
          > to why this would happen or a work around?
          >
          > Here's the code I'm using:
          > lBytes = _root.getBytesLoaded();
          > tBytes = _root.getBytesTotal();
          >
          > percentLoaded = Math.floor((lBytes/tBytes)*100);
          > loader.bar._xscale = percentLoaded;
          > loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) +
          > "K
          > loaded.";
          >
          > if (lBytes>=tBytes && tBytes>0){
          > if (count>=12){
          > gotoAndStop("main");
          > }else{
          > count++;
          > gotoAndPlay("preload");
          > }
          > }else{
          > gotoAndPlay("preload");
          > }
          >


          • 2. Re: Preloading
            aaron17 Level 1
            Ryan,
            It completely bypasses the preloader functionality and keeps going in the timeline on initial publish. When i "simulate download" it doesn't even play the swf, it gets stuck. I tried your suggestion of unchecking the "export in first frame" and I'm getting the same result. I thought possibly that the problem might be because I'm using the scroll pane component multiple times throughout the movie clip that makes up the swf. So, I created a new file only using the scroll pane component once and it had the same result. Any other ideas?

            TIA,
            Aaron
            • 3. Re: Preloading
              Level 7
              If its bypassing the preloader, then my guess would be a scope problem
              within the action script. Mine was having all sorts of funky issues,
              skipping, not starting correctly, etc., and it boiled down to scope and
              referencing the path correctly. W/out knowing the hierarchy of the
              application, I'd suggest prefacing your action script code for the preloader
              to a parent reference, such as:

              _parent.extraStuffHere

              Ryan

              "aaron17" <webforumsuser@macromedia.com> wrote in message
              news:eeegb3$3ab$1@forums.macromedia.com...
              > Ryan,
              > It completely bypasses the preloader functionality and keeps going in the
              > timeline on initial publish. When i "simulate download" it doesn't even
              > play
              > the swf, it gets stuck. I tried your suggestion of unchecking the "export
              > in
              > first frame" and I'm getting the same result. I thought possibly that the
              > problem might be because I'm using the scroll pane component multiple
              > times
              > throughout the movie clip that makes up the swf. So, I created a new file
              > only
              > using the scroll pane component once and it had the same result. Any
              > other
              > ideas?
              >
              > TIA,
              > Aaron
              >