drumn4life0789
02-19-2007, 08:12 AM
Im making a jigsaw puzzle and i was wandering how i can make a timer start when the puzzle begins. I want it to start at 00 and work its way up until the puzzle is finished. Then I want it to go to another frame/scene in which it says your time was and it shows the time there.
thanx if anyone can help
3pepe3
02-19-2007, 10:09 AM
hi...
you can set something like this in the puzzle:
t = 0;
fps = 12;
seconds = 0;
this.createEmptyMovieClip("counter", this.getNextHighestDepth());
counter.createTextField("timer", this.getNextHighestDepth(), 20, 20, 200, 25);
counter.onEnterFrame = function() {
t++;
seconds = Math.floor(t/fps);
this.timer.text = seconds;
};
and when the puzzle has been solved in the next frame some code like this:
delete counter.onEnterFrame
this.createTextField("total", this.getNextHighestDepth(), 20, 20, 200, 25);
total.text="your time: " + seconds
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.