Ok… I wanted to make a 10 second timer made out of bars. For example those preloaders that shows how much completed using a bar that goes to 100%. For the timer I wanted is it counts up to 10 then after that it stops for now. And plz tell me that how to restart the timer again. Thanx
Howdy…
This is the simplest way you can do the job with setInterval() function…
Aw man, you beat me to it Cyan :(…lol.
Good Job on that though
Start and stop and everything
Well I had this so far…
_root.createEmptyMovieClip("container", -1);
container._x = 100;
container._y = 200;
maxClips = 10;
i = 0;
function createClip() {
if (i<maxClips) {
with (_root.container.createEmptyMovieClip("bar"+i, i)) {
moveTo(0, 0);
lineStyle(1, 0x000000, 100);
beginFill(0xE6E6E6, 100);
lineTo(5, 0);
lineTo(5, 10);
lineTo(0, 10);
lineTo(0, 0);
_x = i*8;
i++;
}
} else {
for (j=0; j<maxClips; j++) {
_root.container["bar"+j].removeMovieClip();
}
i = 0;
}
}
createBar = setInterval(createClip, 1000);
If it means anything. Although Cyans method is pretty much better
thats good… but i can u also tell me when its completes the bar gauge like say for example when i done loading it goes to frame 2 of the time line.
and… when its full, i want it stop, then when u press “one” button it will start all over. instead of reset/start
Sorry, lostinbeta… I wasn’t in front of computer today whole day, so I had to make it up fast… =) (Doesn’t this look like some sort of desease???)
_root.createEmptyMovieClip(“container”, -1);
What is the advantage of using ‘-1’??? I saw some people doing it, but I don’t quite get that part…
Hey, Cripple Guy… I made that example for you to see what’s inside and learn how to do that by yourself… I cannot believe that you have learned all the material included in the file in 6 minutes… Open up the file and study how I have done it… I believe that what you are looking for will be solved automatically after you are done studying my file… (apply gotoAndStop() function later on)
Know what I mean??? :rambo:
Well the negative one is/was simple. I could put it back to 1, but originally I had it set up different where the clips were created on levels 1 and up, so I had to create the other clip on level -1 so it wasn’t overwritten.
Now it can be set to whatever, because I create the new clips inside of that clip now. I did that because it is easier to relocate the files x and y coords since all you have to do is move the container clip.
Oh… I think I get the point… Thanks… :beam: