1 Reply Latest reply on Dec 17, 2008 9:04 AM by Ned Murphy

    Preloader Percentage help

    jmd1513
      Hi all,

      Ive seen alot of post about preLoaders throughout the forums and I have probably another typical question about preLoaders. I am using Flash 8 Professional and AS2.

      I have an existing preLoader that uses masks to display an animation loop. I would like to add a percent loaded to it. ( I also need to do this for a new job I just landed ). You can view the preLoader at www.WalkingShadowDesigns.com.

      I've tried the tutorials and everything else. I attached my code, but my aim is to add a % loaded dynamic text field that will update as it loads. I never can seem to get text fields to update whether in a game or preLoader.

      Thanks in advance,
      Josh
        • 1. Re: Preloader Percentage help
          Ned Murphy Adobe Community Professional & MVP
          I'm not sure what you are trying to do in the way of calculating the percent value, but I'll let you wade thru that when you get it to display.

          It is always best to define your variables ahead of manipulating them.

          var loading = 0;
          var percent = 0;
          var total = _parent.getBytesTotal();

          onClipEvent (enterFrame) {
          loading = _parent.getBytesLoaded();
          percent -= (percent-((loading/total)*100))*.25;
          per = int(percent);
          percentage = per+"%";
          if (percent>99) {
          _parent.gotoAndPlay(2);
          }
          }

          If percentage is supposed to be the textfield, there could be one of two problems I know of...

          1) If you've assigned it as the variable name of the textfield, you need to declare the variable ahead of time with the others. var percentage = "0%";

          2) If percentage is the instance name of the textfield, then you need to assign to it using... percentage.text = .... etc