Ok, I don't know how to say this without sounding stupid, but...
I started a game, and it seems great, but I forgot to put in a loading bar.:mad:
How stupid is that!!??
is there any way I can put one in without messing the whole thing up?
Printable View
Ok, I don't know how to say this without sounding stupid, but...
I started a game, and it seems great, but I forgot to put in a loading bar.:mad:
How stupid is that!!??
is there any way I can put one in without messing the whole thing up?
that depends,
just make a backup of your fla file and try one of the many preloader tutorials out there
http://www.google.com/search?hl=en&c...er&btnG=Search
it basicly goes like this in most cases:
you put this code on the very first frame and the whole game after that (e.g frame 2 or better 3 or so:
what it does is for example if you have set your framerate to 32 fps it checks 32 times per second if the loaded bytes of your flash movie match the total to be loaded bytes.PHP Code:stop();
onEnterFrame = function(){
var a = int(_framesloaded);// in case of Null or undefined it returns 0
var b = int(_totalframes);//same here
if (a == b && b > 0){
delete onEnterFrame;
play();
}else{//preloading...
var p = a/b;
trace("movie Loaded: "+int(p*100)+" %");
}
}
Anytime between that it traces out the loaded state in percentage,- you can switch that with a textfield displaying the progress of whats been loaded so far- but then dont forget to embed the digit characters or else anyone else sees a ugly times new roman font without anti- aliasing.
Thanks, its a big help. Btw nice job with your game, cant wait to see ur next entries to the competition.