ON THE FRAME
(select the frame and click F9 and paste the code in)
And then that is it.
Make sure that on frame 2 your movie starts...
Obviously this isnt ment for big scale movies but its good for tests and such.
All code created by me.
And there is no need to make any graphics.
The Actionscript does it all.
stop();
MakeBox();
Ready = false;
mouseClicked = true
_root.createTextField("percent", 2, Stage.width/4, (Stage.height/3)+50, 300, 100);
MakeText("Loading....");
function MakeBox() {
_root.createEmptyMovieClip("loadBox", 4);
loadBox.lineStyle(5, 0x000000, 100);
loadBox.moveTo(Stage.width/4, (Stage.height/3)+120);
loadBox.lineTo((Stage.width/4)+300, (Stage.height/3)+120);
loadBox.lineTo((Stage.width/4)+300, (Stage.height/3)+140);
loadBox.lineTo(Stage.width/4, (Stage.height/3)+140);
loadBox.lineTo(Stage.width/4, (Stage.height/3)+120);
}
function MakeLoadBar() {
_root.createEmptyMovieClip("loadBar", 3);
loadBar.lineStyle(20, 0xf99f99, 100);
loadBar.moveTo((Stage.width/4)+8, ((Stage.height/3)+120)+10);
loadBar.lineTo((Stage.width/4)+(percentage*2.9), ((Stage.height/3)+120)+10);
}
function MakeText(textValue) {
_root.createTextField("loading", 1, Stage.width/4, Stage.height/3, 300, 100);
textFormat = new TextFormat();
textFormat.size = "50";
_root.loading.text = textValue;
_root.loading.setTextFormat(textFormat);
}
function onEnterFrame() {
_root.percent.text = percentage+"%";
percentage = (_root.getBytesLoaded()/_root.getBytesTotal())*100;
_root.percent.setTextFormat(textFormat);
if (_root.percent.text == "100%" && Ready == false) {
MakeText("Click To Play");
Ready = true;
} else if (Ready == false) {
MakeLoadBar();
}
}
function onMouseDown() {
if (Ready == true && mouseClicked == true) {
_root.percent.removeTextField();
_root.loading.removeTextField();
loadBar.unloadMovie();
loadBox.unloadMovie();
gotoAndPlay(2);
mouseClicked = false
}
}
Note: Works best with flash player 7 and above.
Flash player 6 has font problems.
Doesnt work at all with flash 5.
Anyone can use it.