Preloader with String Notifications

From scripting
Jump to: navigation, search
onClipEvent (enterFrame) {
      var bytes = _root.getBytesTotal();
      var bytes_loaded = _root.getBytesLoaded();
		pct = Math.round((bytes_loaded/bytes)*100);
	 	//int percentnumint = bytes_loaded/bytes;
     if (bytes_loaded == bytes) {
          _root.gotoAndPlay(2);
          this.loadervar = "movie loaded";
     } else {
          _root.gotoAndPlay(1); 
		  if (pct > 50 && pct < 62) {
     			this.loadervar = "[ " + pct + "% loaded. ]\n\nHalf way there.\n\n";
		  } else if ( pct > 62 && pct < 74) {
     			this.loadervar = "[ " + pct + "% loaded. ]\n\nThe next time you open this,\n\nit should open immediately.";
		  } else if ( pct > 74 && pct < 86) {
     			this.loadervar = "[ " + pct + "% loaded. ]\n\nHow to use the map:\n\n";
		  } else if ( pct > 86 && pct < 98) {
     			this.loadervar = "[ " + pct + "% loaded. ]\n\nCheck periodically for updates\n\nand site improvements.\n\nThanks for your patience.";
		} else {
			    this.loadervar = "[ " + pct + "% loaded. ]";
		  }
     }	 
}