This is a preloader for jpgs or swfs.
The preloader will show the loading status of a movie or picture. Create an empty movieclip and name it (for example emptyClip. In the empty movieclip which holds the pic or movie add this script. Click on the movieclip and then open the actionscript panel.
onClipEvent(enterFrame){
//This will position the movie, useful when you have slides of different height and width (optional)
this._x = (250-this._width)/2;//250 is hypothetial
this._y = (200-this._height)/2;//200 is hypothetical, test
//message is a textbox showing the bytes loaded
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";
}
}
}
On the main timeline enter this script and then test the movie.
emptyClip.loadMovie("moviename.swf");//or picname.jpg for jpgs