GetTimer()
I want a type of screen saver for my project and i was wondering if like i need to use the getTimer command. So it calculates the time gone by, when a certain time goes by it goes to an intro. If this is possible how would i use getTimer.
Im also sure it will be used on a clipevent
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-19-2002, 02:12 PM
View Complete Forum Thread with Replies
Sponsored Links:
MC/getTimer?
Hello,
Let me see if I can explain this.........
I am trying to play a MC on a timed event(getTimer). I have a MC on the main timeline......
onClipEvent (load) {
time_out = .2*60*1000;
}
// would be about 12 sec, for testing
onClipEvent (mouseMove) {
last_move = getTimer();
}
onClipEvent (enterFrame) {
if ((last_move+time_out)<getTimer()) {
tellTarget ("_root.ballholder") {
gotoAndPlay (2);
}
}
}
Inside that MC I have another MC with a stop on the first frame and another MC(3rd) on the 2nd frame. the 3rd movie clip is a simple motion tween, ball going across the stage. It all works fine except the motion tween in the third MC wont play? It shows the ball with no movement, and exits upon mouse move. Why would the 3rd MC's timeline not play through? I would like to loop the 3rd MC, but I can't even get it to play through once, let alone loop. Any ideas?
Thx in advance!
~GD~
View Replies !
View Related
GetTimer?
hello...im working on a game that needs a timer so i used the getTimer action and it works fine until i go to reset it. i need to be able to do this because i need the timer to start at 0 for each leval of the game...so how do i reset the timer?
i tried to just set the varible the was assigned the timer to zero but thats a no go...
any suggestions welcomed...
View Replies !
View Related
GetTimer() -- Please Help
hi.
Im working with creating a timer for a game.
1.Timer starts on frame 2 of movie.
2.Displayes the current time (always changing).
3.When you get to the end and hit the "agian" button movie goes to frame 2 again and timer starts over.
my question is:
How do i record the amout of time that has passed from the start (on frame 2) to the End as a static number??
as i have it, it records the amount of time SINCE THE MOVIES STARTED PLAYING (not from when the playhead entered frame 2 the last time around)
Please Help!!
I can show my code if that does any good.
Thanks,
Jodi
View Replies !
View Related
HELP GetTimer Can Be Set To 0?
I have a swf with different scenes and with
the getTimer, I can jump to the next scene every
time counting miliseconds...
But when in the last scene I want to put
the REPLAY button, I cannot set the GetTimer to 0,
so the animation jumps to the last scene....
Anybody knows how can I set GetTimer to 0???
Or any Idea about the REPLAY button???
(I cannot use HTML or another SWF!!!)
Thanks!
View Replies !
View Related
GetTimer And What Comes After
Ok, I have a ship that drops a mine when you press a key on your keyboard. In the Mine movieclip it waits an allotted amount of time before exploding. What I can't figure out is how to do is make it so you can only drop one mine at a time, and then when the mine explodess, remove the movieclip. This is what I have so far:
function minefire () {
attachMovie("mineLink", "mineDrop", 0);
mineDrop._x = _root.ship._x;
mineDrop._y = _root.ship._y;
timeMineDropped = Math.floor(getTimer()/1000);
if (timeMineDropped > 5) {
A third question is how I would drop the mine behind the ship when it can rotate in any direction.Any ideas? Thanks,
Andy
View Replies !
View Related
GetTimer...How Do I?
Prob a simple Q, but how do I set up GetTimer on one frame in my movie, I want it to pause for 3 secs then continue, but don't know the exact code, I don't want to load in another movie clip either. Any help would be great
Thanks
View Replies !
View Related
GetTimer Help
Hello,
Having two frames, first frame with circle and second with square.
I want to delay (some seconds) between frames through getTimer AS
Problem is it keeps on looping not going to frame 2.
onClipEvent (load) {
delay = getTimer() + 3000;
trace (getTimer());
}
onClipEvent (enterFrame) {
if (getTimer() >= delay){
gotoAndPlay (2);
trace(getTimer());
}
}
View Replies !
View Related
GetTimer()
Wassup,
Does anyone know if there is a way to stop the getTimer() function from counting the elapsed time of the movie? Is there a way to stop the movie and getTimer()?
View Replies !
View Related
GetTimer ();
Need help,
Making 1st person shooter ......When the time is up it goes to a gamover screen(this all works),the problem is when you restart the game it goes to the gameover screen,this I think is because the timer function is still running >> how do I stop it at the end of the game then start again at the begining code attcahed.
//TIME MC
onClipEvent (load) {
_root.time=0;
_root.timer=0;
}
onClipEvent (enterFrame) {
timer= getTimer ();
_root.time = (timer / 1000);
if(_root.time >=20)
{
_root.gotoAndStop("gameover");
}
//REstart MC
on (release) {
gotoAndPlay (1);
}
}
Should very simple ans.....thanks
View Replies !
View Related
GetTimer ();
I want a timer on my site with the event
on (enterFrame) {
getTimer();
}
I gave that script to a movie clip with a dynamic textfield.
Why can't I see the timer?
View Replies !
View Related
GetTimer();
Hi, I can't seem to get the getTimer();
thing working.
Can anybody explain me how I can get this thing working.
I made a movieclip with a dynamic textbox.
I placed the movieclip on the stage and gave it the actionscript
on (enterframe) {
timer.getTimer();
}
And I named the textbox timer.
What am I doing wrong?
Thanks
View Replies !
View Related
GetTimer()
Hey flashers, I'm trying to have Flash pause for five seconds before it executes a second block of code on a button. Here's the code I got thus far:
on (press) {
_parent.gotoAndPlay("reverse");
}
on (release) {
pause = getTimer();
if (pause>5000) {
;
}
loadMovie ("NYHsyn.swf", "_level0.container");
_level0.container._x = 36.0;
_level0.container._y = 72.0;
}
Basically what I want to occur is, after a movie clip finishes a reverse a animation which ends on frame 40 of an MC, then, I want the loadmovie action to execute. The reverse animation takes at least five seconds, so I need to pause the second code of execution for five seconds. Thanks for any aid.
View Replies !
View Related
GetTimer
I want a type of screen saver for my project and i was wondering if like i need to use the getTimer command. So it calculates the time gone by, when a certain time goes by it goes to an intro. If this is possible how would i use getTimer.
Im also sure it will be used on a clipevent
View Replies !
View Related
GetTimer I Don't Know Where I Can Use It
Hi all I am using flash 5 authoring software
suppose that I have a sound
and I have already calculated it's time
for example 16
after counted time I want to subtract that time
from this variable to recount again
how to do it and when we use it
this is the code when it run after that sound
the sound repeated million because of enterFrame event
look my problem that I want to calculate the time
after calculated I want to clean that variable with time
to start counting again that’s all how can I ?
onClipEvent(load) {
i = 1;
mySound = new Sound();
mySound.attachSound("A" + i);
mySound.start();
}
onClipEvent(enterFrame) {
time = getTimer()/1000;
sounder(time);
function sounder (time) {
if(time > 11){
if(i > 2){
i = 0;
}
i++;
mySound.attachSound("A" + i);
mySound.start();
}
}
}
please someone help me my mind blowed (*^*)
View Replies !
View Related
GetTimer ();
ok,
I'm trying to learn to use the getTimer Function. with no success.
I want to wait 10secs then play a simple motion tween, where the circle slides off the screen. instead what I get is this:
http://209.41.175.229/neegrita/problems/
as you can see after 9 secs it just moves one frame and does not play the whole tween.
why does it do it after 9 secs (9.9 to be exact) and doesn't play the whole tween?
here's my code on the circleMC (c1):
onClipEvent (enterframe){
waitTime=getTimer ();
if (waitTime > 10000){
_root.c1.gotoAndPlay (2);
}else{
_root.gotoAndPlay (1);
//display milSecs in textbox
_root.displayTime = getTimer();
}
}
for flash 5, thanks!
View Replies !
View Related
GetTimer
Peeps, I use the GetTimer script and I put this on frame 200. But when my movie starts and comes at frame 200, the timer that I uses already ahs played 24 seconds or so. But want it to start at 00:00:00
how is this possible?
This is the script at frame 200:
gT = getTimer();min = Math.floor (gT/60000); sec = Math.floor ((gT-min*60000)/1000);mili = gT-min*60000-sec*1000
tijd= (min < 10 ? "0"+min : min ) + " : " + (sec < 10 ? "0"+sec : sec) + " : " + (mili < 10 ? "0"+ mili : mili);minfield = tijd;
View Replies !
View Related
GetTimer?
hi
i need to run a different set of action at 15 second intervals but i am unsure what code to use to do so. is is getTimer? or something else? can someone give me a sample piece of code? thanks!
View Replies !
View Related
GetTimer() ?
Hi.
I´m creating a system which should contain a multiple set of Timers. I would like to have one on each frame, which should be seperate from the other ones.
The problem I have now is when I start one Timer, goes to another frame and wants to start that timer, it´s already counting since I started it on frame one.
Can this be solved?
Thnxs.
/Petter
View Replies !
View Related
GetTimer();
I have around 15-20 movie clips, which I have embedded in a main movie clip. I want to know the time elasped after playing 4 movieclips in the timeline, I want to change the bg sound after the 4th clip. But I am not able to get the total time elasped after playing the 4 movie clips.
I know I can use the getTimer function, but I don't know exactly how can I use it. I have put it on a frame, but it does not show the time anywhere while playing the swf or the .exe projector
I know it is a stupid question, but I need an answer.
Regards,
Vaibhav Kapoor
View Replies !
View Related
GetTimer()
I have made a rollover Flash menu for:
http://www.online-mixing.com
The menu works by your mouse rolling over a main section e.g. "Contact" and the submenu pops up above it. I have set a surround box to go around the edge of it so when your mouse moves away from the submenu buttons it goes over this surrounding box. I have set some action script to tell the menu to collapes the submenu when this happens. However l have noticed a bug whereby if you move your mouse really quickly off the menu the flash menu still thinks the mouse it there!
Is there a way that l can set a default time for the submenu to collapse?
Luke
View Replies !
View Related
Using GetTimer.
I am trying to create a program to calculate your reaction time.
I want to establish this by using getTimer.
I am not a beginner to AS, but I have just never worked with getTimer.
So.. Is there any information you can tell me about it? How do you use it? How do you start it, stop it, etc? thanks!
View Replies !
View Related
GetTimer
In my movie, I want to depress the mouse button and run certain commands dependent on the amount of time the mouse has been depressed. For example, if the mouse has been depressed for 3 seconds do this and if for 5 seconds do this.
It would appear I would use the getTimer script to determine the amount of time, but how would I write the code? Also, would I need to setup variables in the code?
Any tips to point me in the right direction would be helpful
Thank you,
View Replies !
View Related
GetTimer
I'm new to actionScript and I was trying to figure out how to use getTimer. My goal is to display my age in hours, minutes, or seconds. Or some combination of those.
I found this but I think it does not apply to actionScript 3.0
this.onEnterFrame = function() {
var time = new Date();
var hours = time.getHours();
var minutes = time.getMinutes();
var seconds = time.getSeconds();
}
How do I use getTimer in actionScript 3.0? I don't think that will be too hard but I am also unclear on how I would calculate my age based on the information I get from getTimer.
Any Suggestions?
View Replies !
View Related
GetTimer
I have a MC with a motion tween inside of it. At the end of the motion tween I have
ActionScript Code:
stop();if (getTimer()>=5000) { gotoAndPlay("stairs");}
Why doesn't this work? It does not wait 5seconds. The scope looks right as well so I'm stumped
Sandman9
View Replies !
View Related
As Help With GetTimer
Does anyone Know how to reset time in Flash?
Because i try to make a game where i used getTimer to get the time that a player took to play the game. At the end i display the resurt in a dynamic field, including the length of the game . I've also put a restart button wich allow the user to replay another game. The problem that i'm having is that i can reset the time used by the player. For example if in the first game your time is 1:33 and then you replay the tim does'n t start counting on 0:00 but on 1:33 and then continue.
here is the code
on frame 1;
// a global variable wich will keep the value of the time
_global.tempsFinal = 0;
// get the time while your playing since you started playing
var intervalTime = setInterval(getSecondes, 100);
function getSecondes() {
var my_dateate = new Date();
var econdes:Number = Math.floor(getTimer()/1000)%60;
var minutes:Number = Math.floor((getTimer()/1000)/60);
}
// to display the time in a dynamic field
temps.text = minutes+":"+secondes;
// the code for the button to display the results
ShowResult_btn= function(){
gotoAndStop(10);
tempsFinal = minutes.toString()+":"+secondes.toString();
}
on frame 2
this is the code on the button if you want to restart
restartBtn.onPress = function() {
_global.tempsFinal = 0;
gotoAndStop(1);
}
Does any one knows a better way to do the same task?
thnks
wo1olf
View Replies !
View Related
Use Of Gettimer
i wish to know how to use the gettimer to run my on(press) function..
let say i have an array consist of 10 elements, and each element will be called for an interval of 2second.. how can i actually code it out?
i've tried something with this..
for (i=0;i<array.length;i++){
{A=gettimer()
if (gettimer()>2000)
{//run action
}
}
but it doesnt work..
View Replies !
View Related
GetTimer
I have a MC with a motion tween inside of it. At the end of the motion tween I have
ActionScript Code:
stop();if (getTimer()>=5000) { gotoAndPlay("stairs");}
Why doesn't this work? It does not wait 5seconds. The scope looks right as well so I'm stumped
Sandman9
View Replies !
View Related
GetTimer()
I am working on Scene 1 and scene 2 in my Flash file. When I click on a button to go to Scene 2, it does not stop on (Scene 2, frame 1), Instead it plays the whole movie (frame labelled "hand"), as per the onEnterFrame function below.
ActionScript Code:
_root.onEnterFrame = function() {
if (getTimer()>10000) {
_root.gotoAndStop("hand");
}
};
Is there any other simple way to make use of the getTimer (with an Enterframe function, if necessary) but the movie stops on (Scene 1, frame1), waits for 10 seconds and then go to frame "hand"
Thanks
View Replies !
View Related
What Exactly Is GetTimer()?
I understand what getTimer does (I often use it), but what is it? How does it fit into AS 3.0's OOP framework? It's not just a toplevel function, like trace(). You have to import it:
import flash.utils.getTimer;
But then you use it without any qualifying class reference. It's not SomeClass.getTimer(). It's just getTimer(). So somehow you're importing a function, not a class. I didn't think you could do this. Can you? Can you make your own importable functions (without using includes)? Or is this just a weird, built-in exception. There's certainly no file on my system called getTimer.as.
View Replies !
View Related
GetTimer() PC And MAC
on my PC the getTimer function can update as fast as the frame rate of the main flash movie, however on a mac the getTimer function seems to only update every 6 or 7 seconds.
heres the code:
onClipEvent (load) {
_root.accrualRatePerSecond = 9.93;
_root.StartAmount = 533330009;
_root.DateYear = 2003;
_root.DateMonth = 11;
_root.DateDay = 30;
currentDate = new Date();
thisYear = currentDate.getFullYear();
eventDate = new Date(_root.DateYear, (_root.DateMonth-1), _root.DateDay);
eventMillisecs = eventDate.getTime();
}
onClipEvent (enterFrame) {
currentDate = new Date();
currentMillisecs = currentDate.getTime();
trace(currentMillisecs);
this.msecs = (eventMillisecs-currentMillisecs)*-1;
CurrentAmount = (this.msecs*(9.93/1000));
CurrentAmount = int(_root.StartAmount+CurrentAmount);
CurrentAmount = CurrentAmount.toString();
_root.amountMain = CurrentAmount;
}
Pretty simple really works fine on a PC but on a mac the timer dosnt update as fast as the framerate... is there a workaround?
Thanks
Rez
View Replies !
View Related
Reseting GetTimer
Has anyone had any experience with reseting the getTimer()
object back to "0" ? I'm working on a timed piece where
movie clips and files are activated only at a specific time.
The major problem is....when the file loops to play again,
the file plays through without a timer. Nothing stays synched !! I tried to reload a projecter after quitting the current file, I've also tried reloading the .swf file into
_level0 to restart. I'm running out of options. Any help would be greatly appreciated! THaNk YoU!
View Replies !
View Related
Odd GetTimer() Behavior
I'm using getTimer() in a function to create a 3 second delay before proceeding to the next frame. Prior to the delay, I'm attempting to move a Movie Clip along the x axis. When I execute the code in the standalone player, I see the Movie Clip's new position after the delay code has ran. I'm still kind of new to Flash, so maybe I'm just missing something.
I've wasted about a day now rewriting this code. Does anyone have a suggestion? Any help is greatly appreciated.
Here's my code:
function display() {
if (x == 0) {
//MOVE CLIP;
movieClip._x = 400;
//PAUSE IS HAPPENING BEFORE MOVIE CLIP'S NEW POSITION
//IS DISPLAYED
start = getTimer();
while (start + 3000 > now) {
now = getTimer();
}
}
Thanks for looking.
View Replies !
View Related
Reset GetTimer() ?
Hi,
I'm using the getTimer function on about frame 5 of my movie but it seems to start on about 3 secs because of this. Is there any way to reset the function to zero?
Thanks.
View Replies !
View Related
GetTimer Questions
I'm trying to use getTimer so I can move from one frame to the next frame in a movie clip instance after 15 seconds, but i've been unsuccesfull in my attempts. Can someone post or direct me to a tutorial on how to use getTimer in this type of script?
View Replies !
View Related
Controling GetTimer() ---------- HELP
Is there a way to start and stop this function at will.
I have it on the second frame of my movie with a stop on the first frame. I want this timer to start when the user gets to the second frame. The way it works now is that if the user is on the first frame for 20 second, the timer will start at 20 seconds.
View Replies !
View Related
Help - Stoping GetTimer()
Hi there,
This is probably a really easy question for many people but it has me stuck.
When the file is loaded (i.e. percent == "100%")
I want to stop the getTimer function so I can tell how long the file too to load.
Any idea's?
onClipEvent (load) {
total = Math.round(_root.getBytesTotal()/1000);
total = total+"k"+"//";
}
onClipEvent (enterFrame) {
seconds = (getTimer()/1000);
download = Math.round(_root.getBytesLoaded()/1000);
download = download+"k";
bytesleft = Math.round(_root.getBytesTotal()-_root.getBytesLoaded()/1000);
bytesleft = bytesleft+"k";
percent = Math.round(_root.getBytesLoaded()/_root.getBytesTotal()*100);
percent = percent+"%";
// loadVariables ("test.txt", "mtv_txt");
// percent = percent + "//";
// loadingone = "total file size=" + total + "k" + "//" + "downloaded=" + download + "k";
// loadingtwo = "percentage=" + percent + "//" + "kilobytes remaining=" + bytesleft + "k";
if (percent == "100%") {
_root.gotoAndplay(2);
}
Cheers,
Sean.
}
View Replies !
View Related
GetTimer Problem...
I made a MC with this code
Frame1:
startTime = getTimer()/1000;
Frame2:
actualTime = getTimer()/1000-startTime;
if (actualTime >= 3) {
_parent.gotoAndStop("Szene4", 1);
} else {
this.gotoAndPlay(2);
}
but it doesnt jumps to Szene4 .... !!! Why the hell ???
View Replies !
View Related
GetTimer() - Reset?
Hello to everyone!
Does anyone know if it's possible to reset the getTimer() function while staying within a movie?
I'm creating a racing game, and need the time to reload each race, however even when the timer is placed in a seperate swf and loaded/unloaded, the timer remains!
Does anyone know how to reset the getTimer() function?
-- Or know the alternative -- use a date object to set the amount of milliseconds at the start, and then check that from the difference at the end??
Thanks!
View Replies !
View Related
GetTimer Problem
How to make a movie like...
the movie plays until frame 20 and then stops for 3 seconds and then plays on...
I thought i was so:
In frame 20 actions:
stop();
timer1 = getTimer()/1000;
In frame 20 movieclip actions
onClipEvent(enterFrame) {
timer2 = getTimer()/1000;
if (timer2 - timer1 == 3) {
play();
}
}
I thought it was so but it won't work... It just stops at frame 20 and does nothing...
Any help would be appreciated
View Replies !
View Related
Reset GetTimer()
Ok it all works but when I reset it dosen't I know I am reseting it in the wrong place or something stupid like that .
Code:
onClipEvent (load) {
start=getTimer()/1000;
end=10;
}
onClipEvent (enterFrame) {
if (_parent._currentframe>1) {
now=getTimer()/1000-start;
if (now>=end) {
_root.eventsadd=false;
}
}
// here I want the timer to start back to 0;
//so when it is called again it will do the if statement
start=getTimer()/1000;
}
View Replies !
View Related
Resetting GetTimer ?
I'm using getTimer(); in a countdown. When it reaches 0, it goes to a 'end game' scene. In this scene there is a button to play again, which uses gotoAndPlay (Scene 1,1) to start again.. but the countdown now starts from 0, going to -1, -2 etc.
Does getTimer() find the elapsed time of a MOVIE ? I thought so, so replaced "gotoAndPlay (Scene 1,1)" with:
unloadMovieNum (0);
loadMovieNum ("04cardriver6.swf", 0);
which I thought would work, but doesn't...
Does this mean getTimer() uses the elapsed timne of the opening of the FLASH PLAYER?
View Replies !
View Related
Problem With GetTimer
i have a problem with getTimer assignment.
can someone tell me.
the file should of shut down when the seconds are gone from 60 to 1. but this does not happen.
1. when i enter my name "furqan" , it goes to the next scene. this function is working okay
2. if i enter wrong entry it should be close but this does not happen after 3rd entry. I can't control it.
3. the user should have only 1 minute(60) seconds to enter right name if he fails the file should be close but this is not possible for me. i am feeling a great headache.
the source file u can download from this url.
http://www.geocities.com/furqanweb
View Replies !
View Related
|