jpg or swf loader

Download file here.
This is a preloader for jpgs or swfs. It will show the loading status of a movie or picture.


In the empty movieclip which holds the pic or movie add this script:

onClipEvent(enterFrame){
		    //this will center the movie or pic.
			this._x = (250-this._width)/2;
			this._y = (200-this._height)/2;
		    if(this._url != _root._url && !this._url.loaded) {
		        var kilobytes = Math.ceil(this.getBytesTotal()/1024);
		        var percentLoaded = Math.ceil((this.getBytesLoaded()/this.getBytesTotal()) * 100);
		        _root.message.html=true;
				_root.message.htmlText = "loading " + percentLoaded + " % of " + kilobytes + " k";
		        if(this.getBytesLoaded()>= this.getBytesTotal() ){
		             loaded = true;
		             _root.message.htmlText = "Ready";
		        }
	    }
}