Script only Pre-Loader

Hey guys,

I got my little fingers on this snazzy pre-loader that if fully scripted and no objects are requiered what-so-ever… :smiley:

But… Oh, yes… the BIG BUT!!!

It only works in a swf file that is published as a Version 6 file… it won’t work on either Flash 7 or even 8, and i would love to use it really badly…

[color=red]Here it is… but i modified for my site…[/color]

 
if (getBytesLoaded() != getBytesTotal()) {
loaderColour = 0xaac534;//CHANGE THIS TO CHANGE THE COLOUR.
loaderWidth = 200;//CHANGE THIS TO CHANGE THE LOADER WIDTH.
loaderHeight = 10;//CHANGE THIS TO CHANGE THE LOADER HEIGHT.
//THESE CENTER THE LOADER.
Xpos = Stage.width/2-(loaderWidth/2);
Ypos = Stage.height(450);
//-------------------------------------------------
createEmptyMovieClip("loaderBar", 2);
loaderBar._x = Xpos;
loaderBar._y = Ypos;
with (loaderBar) {
beginFill(loaderColour, 100);
lineStyle(0, loaderColour, 0);
moveTo(0, 0);
lineTo(1, 0);
lineTo(1, loaderHeight);
lineTo(0, loaderHeight);
endFill();
}
//--------------------------------------------------
chunk = loaderWidth/100;
loaderBar.onEnterFrame = function() {
this.soFar = Math.round((getBytesLoaded()/getBytesTotal())*100);
this._width = chunk*this.sofar;
if (this._width == chunk*100) {
play();
removeMovieClip(loaderBox);
removeMovieClip(loaderBG);
removeMovieClip(this);
}
};
stop();
}
 

And here is the original… still the same though…


if (getBytesLoaded() != getBytesTotal()) {
loaderColour = 0xff0066;//CHANGE THIS TO CHANGE THE COLOUR.
loaderWidth = 200;//CHANGE THIS TO CHANGE THE LOADER WIDTH.
loaderHeight = 10;//CHANGE THIS TO CHANGE THE LOADER HEIGHT.
//THESE CENTER THE LOADER.
Xpos = Stage.width/2-(loaderWidth/2);
Ypos = Stage.height/2-(loaderHeight/2);
//-------------------------------------------------
createEmptyMovieClip("loaderBar", 2);
loaderBar._x = Xpos;
loaderBar._y = Ypos;
with (loaderBar) {
beginFill(loaderColour, 100);
lineStyle(0, loaderColour, 0);
moveTo(0, 0);
lineTo(1, 0);
lineTo(1, loaderHeight);
lineTo(0, loaderHeight);
endFill();
}
//--------------------------------------------------
//DELETE THIS SECTION IF YOU DON'T WANT A BACKGROUND.
createEmptyMovieClip("loaderBG", 1);
loaderBG._x = Xpos;
loaderBG._y = Ypos;
loaderBGColour = 0xCCCCCC;//CHANGE THIS TO CHANGE THE COLOUR.
with (loaderBG) {
beginFill(loaderBGColour, 100);
lineStyle(0, loaderBGColour, 0);
moveTo(0, 0);
lineTo(loaderWidth, 0);
lineTo(loaderWidth, loaderHeight);
lineTo(0, loaderHeight);
endFill();
}
//-------------------------------------------------
//INCLUDE THIS SECTION IF YOU WANT A BORDER.
/*createEmptyMovieClip("loaderBox", 3);
loaderBox._x = Xpos;
loaderBox._y = Ypos;
boxLineColour = 0x000000;//CHANGE THIS TO CHANGE THE COLOUR.
with (loaderBox) {
lineStyle(1, boxLineColour, 100);
moveTo(0, 0);
lineTo(loaderWidth, 0);
lineTo(loaderWidth, loaderHeight);
lineTo(0, loaderHeight);
lineTo(0, 0);
}*/
//-------------------------------------------------
chunk = loaderWidth/100;
loaderBar.onEnterFrame = function() {
this.soFar = Math.round((getBytesLoaded()/getBytesTotal())*100);
this._width = chunk*this.sofar;
if (this._width == chunk*100) {
play();
removeMovieClip(loaderBox);
removeMovieClip(loaderBG);
removeMovieClip(this);
}
};
stop();
}

Neither of the work in the flash 7 or 8 files… even in its original state… And if i knew ActionScripting… i think i would still be stumped… :worried:

Any help would be great.

Thanks in Advanced.
Michael.