3 Replies Latest reply on Mar 31, 2007 11:57 PM by kglad

    How can I put a text preloader into this code?

    kingmonkey Level 1
      Hi

      I've been working on a site where swf's are loaded into main movie with transitions between the sections. I have the following code on the mcContainer...

      [CODE]onClipEvent (enterFrame) {
      if (!loaded && this._url != _root._url) {
      if (this.getBytesLoaded() == this.getBytesTotal()) {
      loaded = true;
      _root.transition.gotoAndPlay("opening");
      }
      }
      }
      [/CODE]

      How can I add a text percentage preloader into this code?

      I usually use a the following code for preloaders...
      [CODE]myLoaded = Math.round(getBytesLoaded());
      myTotal = Math.round(getBytesTotal());
      myPercent = myLoaded/myTotal;
      myBar._height = myPercent*97;
      myText = Math.round(myPercent*100)+"%";
      if (myLoaded == myTotal) {
      gotoAndStop("Scene 1", "loaded");
      } else {
      gotoAndPlay("Scene 1", "preloader");
      }
      [/CODE]

      ... but I'm not sure where to add the code into the exisiting code, as I'm a beginner at AS.

      Any help will be greatly recieved.

      Thanks
      Wayne