Flash CS4 AS2 -Basic loading bar preloader 050

 http://flashexplained.com/preloaders/basic-loading-bar-preloader/

siteLoader.loadMovie(“mysite.swf”);
loadingBar._xscale = 1;
loadingBar.onEnterFrame = function() {
kBytesLoaded = this._parent.siteLoader.getBytesLoaded() / 1024;
kBytesTotal = this._parent.siteLoader.getBytesTotal() / 1024;
percentage = Math.round(kBytesLoaded / kBytesTotal * 100);
this._xscale = percentage;
if (percentage == 99) {
delete this.onEnterFrame;
}
}

Advertisements

Post a Comment

Required fields are marked *
*
*

%d bloggers like this: