1 Reply Latest reply on Jun 1, 2006 1:56 PM by Newsgroup_User

    "Loading" script

    CharlyAR
      Hello everybody. I'm rusted using Flash, and I have a doubt...
      I know that I can google about making a "Loading" movieclip, but looking at different scripts I foudn in the net, I was wondering...

      Why can't I use a script like this one (that it seems more... simple to me, and is the one I came up with):

      PS: Yeah, I know, I'm rusted about speaking english too
        • 1. Re: "Loading" script
          Level 7
          "CharlyAR" <webforumsuser@macromedia.com> wrote in message news:e5nekg$5gi$1@forums.macromedia.com...
          > Hello everybody. I'm rusted using Flash, and I have a doubt...
          > I know that I can google about making a "Loading" movieclip, but looking at
          > different scripts I foudn in the net, I was wondering...
          >
          > Why can't I use a script like this one (that it seems more... simple to me,
          > and is the one I came up with):
          >
          > PS: Yeah, I know, I'm rusted about speaking english too
          >
          >
          > total = _root.getBytesTotal();
          > cargado = 0;
          > do {
          > this.gotoAndPlay("1");
          > cargado = _root.getBytesLoaded();
          > } while (cargado < total);
          >
          > this.gotoAndPlay("3");

          Several problems with your code Charly..

          You need to let Flash come and go between frames, not trap it in a while loop. When you use onEnterFrame it comes back again once
          per frame to check on the progress of the loading, then goes back out to update other things like display and other parts of your
          program like movieclips etc. If you use a while loop, flash gets stuck there the whole time and can give you a "An ActionScript is
          making Flash run slowly" error condition.

          When you want to gotoAndPlay a frame number, don't put the number in quotes like "1" because that changes it from a number to an
          alpha character. It still works sometimes but you shouldn't do it because it makes Flash look for a frame label with that name
          first.

          tralfaz