Need Count Up Timer For MX 2004- 09:00:00 To 09:30:00
Hello,
Does anyone have or can anyone direct me to actionscript that can count up from 09:00:00 to 09:30:00?
It would need to change the seconds and the minutes. I am a designer with a light understanding of actionscript. Yet I haven't been able to find something I could edit to fit that criteria.
Any help would be greatly appreciated!! I'm in a bind.
Thanks, J.
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-18-2005, 04:42 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Count Down Timer Changes In Count Up
Is it possible to make a count up timer (from a specific date, birthday for exemple) from the count down timer ?
I've tried to change a few things (I'm very bad in programming) but I can't get the date properly.
If not, do somebody know a count up timer (.fla) that I can use ?
Thanks, thanks, thanks
Frankie
Count Down Timer Changes In Count Up
Is it possible to make a count up timer (from a specific date, birthday for exemple) from the count down timer ?
I've tried to change a few things (I'm very bad in programming) but I can't get the date properly.
If not, do somebody know a count up timer (.fla) that I can use ?
Thanks, thanks, thanks
Frankie
Count Down Timer
hi anyone know how to put a script on the main movie to make a countdown timer(global variables or stuff),so that when the user go to other scenes or within the main scene, after certain of time, the movie replay or reset to original state?
i would like to do a simple game for sch project, hope u can help.
thanks.
for example,
i set the count down time to 30 secs then it start counting when user have no mouse action.
really appreciated if anyone can help.
thks
Count Down Timer
Does anyone know how I can create a count down timer in actionscript?
I want to delay an event until a certain amount of time has passed.
Any help would be great!!!
Thanks
Timer To Count Down
i have videos in a flash presentation and i want people to be able to see how much time is left on them.
the only controllers i have on them now are some basic buttons- play, ff, rw, pause.
i thought the easiest way to show how much time is left would be to have a dynamic text field that counts backwards in relation to how much of the video has been played.
the time wouldnt relate to data loaded (like a preloader would) because the vids are on a cd so the whole video is already loaded.
i have followed a few text book tutorials but i cant really adapt them to my situation (action script is not my forte).
anyone know how to do this? im sure its easy but i dont know where to start.
also, i have no idea what im doing, so please- i need things explained to me!
cheers
Count Down Timer ?
Looking for an open source file just like this:
http://www.flashkit.com/movies/Utili...0276/index.php
except this one counts time forward. I need to count down until a specified time. (I'd modify that file but the movie files are currupt)
edit: I think i found one....wow, had to search deep but I got one.
Count Up Timer
Hi, I was hoping someone could give me some help. I am trying to create a count up timer for my flash designed CV, it needs to sit in my flash movie and be constantly counting up in years days hours minutes seconds and milliseconds from the date i started my professional career. for instance..
06 years 224 days 04 hours 15 minutes and 33 seconds 712 milliseconds
professional experience.
I already have a flash file for a counter that counts down to a certain date and am wondering if it is possible to reverse the timer and put in the time and date i started my career so it keeps count for me and tells potential employers how much experience I have. I also need to add in years as the countdown timer only counts in days.
I have uploaded the file if anyone needs to look at the code... or would be kind enough to edit it for me? or let me know if it would be easier to build a different one and how.
http://www.boojak.com/counter/countdown.fla
thanks
[F8] Count Up Timer
Hello,
I am trying to find a way to script a count up timer. The timer would have seconds(no milliseconds), minutes, and hour fields. This timer will be implemented into a game to show how long the person has been playing it. I would like it to start as soon as the .swf is opened.
Thank you for any insight!
Count Down Timer?
I can't get this timer to work.What am I missing?
this.onEnterFrame = function(){
var todayate = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();
var targetDateate = new Date(currentYear,11,25);
var targetTime = targetDate.getTime();
var timeLeft = targetTime - currentTime;
var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hrs = Math.floor(min/60);
var days = Math.floor(hrs/24);
sec = string(sec % 60);
if (sec.length < 2) {
sec = "0" + sec;
}
min = string(min % 60);
if (min.length < 2) {
min = "0" + min;
}
hrs = string(hrs % 24);
if (hrs.length < 2) {
hrs = "0" + hrs;
}
days = string(days);
var counter:String = days + ":" + hrs + ":" + min + ":" + sec;
time_txt.text = counter;
}
Count Down Timer
I need some help. I have a web site that till tell the blight of cats and
dogs in shelter and rescues that have a short time to live before they are
put down to make room for other stray pets.
I need a dynamic countdown timer in black with white numbers that countdown
days, hours, and minutes (possibly seconds for dramatic effect). Anywhere I
can find such a movie? I found a bunch of cheesy ones online and a bunch
that do way too much.
When the rescue or shelter moves the pet to LCP status, they will enter a
date into the database. I need the time to use that as the starting point
and count down till that date and time arrives. I am using coldfusion as the
dev coding for the site.
Please let me know where I can find such a movie or how much it will cost to
have one done.
Thanks.
Count Down CLOCK/TIMER
hello.
I am trying to create a timer which counts down from 4:00 minutes to 0:01 second. What would be the best way to go about doing something like this?
Any suggestions, help, or a point in the right direction would be greatfully appreciated.
cheers-
ryan
What's Wrong? - Timer Count Down (mx)
In a game I have a mc on the stage with this actionscript:
onClipEvent (load) {
startTime = getTimer();
}
onClipEvent (enterFrame) {
currentTime = getTimer();
elapsedTime = Math.round((currentTime-startTime)/1000);
_root.timeRemain = 20-elapsedTime;
if (_root.timeRemain <=0) {
gotoAndStop(20);
}
}
It's not working.... why?!???
The timeRemain just keeps on counting down to negative numbers.
The game loops in 5 frames. Has it anything to do with that?
Count Up Timer For Game
I used this code to make a counter.......... It works the first time, then, when the game goes back to the beginning the counter goes double time... Then, you restart and the counter goes tripel.... I have it going back to the first frame which sets the time back to 1...
What am I doing wrong. Thank you...
Here's the code
setInterval(countup, 1000);
time = 1;
function countup() {
time += 1;
}
Count Up Timer At 76 Per Minute
Hi,
I am a new user to both Flash MX and this forum and was wondering if anybody could help.
I am trying to create a timer that counts up 76 units for every minute elapsed (I am trying to create a visual pulse timer). I want it to count up from 0 and not have increments of hours/minutes/seconds etc but just count up as one number getting larger. I have downloaded the following script and can't see a way of changing it so that it works. can anyone help?
//initial variables
var timing:Boolean = false;
var paused:Boolean = false;
var remaining:Number;
var elapsedTime:Number;
var elapsedHours: Number;
var elapsedM:Number;
var elapsedS:Number;
var elapsedH:Number;
var startTime:Number;
var remaining:Number;
var hours:String;
var minutes:String;
var seconds:String;
var hundredths:String;
_root.play_btn.onPress = function() {
if(!_root.timing) {
if (_root.paused) {
_root.startTime = getTimer() - _root.elapsedTime;
} else {
_root.startTime = getTimer();
}
//start timer
_root.paused = false;
_root.timing = true;
}
}
_root.stop_btn.onPress = function() {
//stop the timer
_root.timing = false;
//reset the paused variable
_root.paused = false;
//reset the display textbox
_root.timer_txt = "00:00:00:00";
}
_root.pause_btn.onPress = function() {
//only pause if the timer is actually going
if(_root.timing) {
_root.timing = false;
_root.paused = true;
}
}
_root.onEnterFrame = function() {
if (timing) {
//calculate values
elapsedTime = getTimer()-startTime;
//hours
elapsedHours = Math.floor(elapsedTime/3600000);
remaining = elapsedTime-(elapsedHours*3600000);
//minutes
elapsedM = Math.floor(remaining/60000);
remaining = remaining-(elapsedM*60000);
//seconds
elapsedS = Math.floor(remaining/1000);
remaining = remaining-(elapsedS*1000);
//hundredths
elapsedH = Math.floor(remaining/10);
//output to text box
//add a 0 on the front of the numbers if the number is less than 10
if (elapsedHours<10) {
hours = "0"+elapsedHours.toString();
} else {
hours = elapsedHours.toString();
}
if (elapsedM<10) {
minutes = "0"+elapsedM.toString();
} else {
minutes = elapsedM.toString();
}
if (elapsedS<10) {
seconds = "0"+elapsedS.toString();
} else {
seconds = elapsedS.toString();
}
if (elapsedH<10) {
hundredths = "0"+elapsedH.toString();
} else {
hundredths = elapsedH.toString();
}
_root.timer_txt = hours+":"+minutes+":"+seconds+":"+hundredths;
}
};
Help With ActionScript And A Count Down Timer
HI I have created a movie Clip for a count down timer. The Count down timer movie clip has two layers with only one fame each. The first layer is the actions, the second holds a text field with a variable name timer_txt and this is where the count down timer results are shown.
I have managed to get the timer to go down to zero, however, i need it continue into negative numbers. What I thought was to have a booleen value which will change the timer from subtracting to adding 1. But this does not work... can you please help me with this.
The following is the code in the actions layer on frame one :
Code:
//initial variables
var timing:Boolean = false;
var paused:Boolean = false;
var remaining:Number;
var elapsedTime:Number;
var elapsedHours:Number;
var elapsedM:Number;
var elapsedS:Number;
var elapsedH:Number;
var startTime:Number;
var remaining:Number;
var hours:String;
var minutes:String;
var seconds:String;
var hundredths:String;
var timeOut:String;
startTime = getTimer();
timing = true;
var timeSec:Number;
var timeSecStr:String;
var timeMin:Number;
var timeMinStr:String;
timeSec = 60;
timeMin = 10;
//_root.createEmptyMovieClip("countDown", 10);
//cCenterX = Stage.width/2;
//cCenterY = Stage.height/2;
//_root.countDown.createTextField("myTextField", 1, cCenterX, cCenterY, 30, 20);
//_root.countDown.myTextField.background = true;
//_root.countDown.myTextField.autoSize = "center";
//_root.countDown.myTextField.border = true;
//_root.countDown.myTextField.backgroundColor = 0x00FFCC;
count = 3;
minCount = 9;
timeOut = "F";
myCountDown = function () {
if (this.timeOut == "F") {
count--;
if (count == 0){
var myTextFormat = new TextFormat();
myTextFormat.color = 0xff0000;
this.timer_txt.setNewTextFormat(myTextFormat);
this.timeOut = "T";
}
}
else if (this.timeOut == "T"){
count++;
}
}
countInterval = setInterval(myCountDown, 1000);
this.onEnterFrame = function() {
elapsedH = Math.floor(count/60);
elapsedM = count-(elapsedH*60);
if (timeOut = true){
timer_txt = "-";
}
else if (timeOut = false){
timer_txt = "";
}
if (elapsedH < 10){
timer_txt = "0" + elapsedH;
}else
{
timer_txt = elapsedH;
}
if (elapsedM < 10){
timer_txt += ":0" + elapsedM;
}else
{
timer_txt += ":" + elapsedM;
}
//timer_txt = mincount + ":" + count;
//if (count == 0) {
//
//clearInterval(countInterval);
//timer_txt = "00:00";
//}
}
Please note that there are some redundant variables in there, and while I have been trying to solve this the code has become messy.
Timer/Date - How To Count The Days Since A Day
If you look at my footer, you will see the Windows XP thing. Rather than editing it every single day, and to set my self a challange, I want to make a Flash SWF that will do it for me I asume using the getDate function.
I am not great at AS, I can drag windows, open URLs and make forms, but noting major like this.
I have looked at the tuts and I can't see anything to sort my problem.
How can I count the days since March 2nd 2002 (when I got XP)?
I have Flash 5 and MX.
Thank you in advance.
Count-Up Timer: I've Wracked My Brain...can Anyone Help?
Ok, I'm trying to create a count up script that takes a date that I specify and checks the UTC and displays how many days, hours, minutes, seconds have passed since that interval. This is the coding that I have so far and I can't seem to get anything to work. Can anyone help me out?
Code:
dateNow = new Date();
timeNow = dateNow.Date.UTC(year, month, date, hour, min, sec);
dateThen = new Date();
startDate = dateThen.setDate();
difference = (dateNow - startDate);
dayNumber = difference/86400; // 24 hrs * 60 min * 60 sec
days = int(dayNumber);
hourNumber = (dayNumber - days)*24;
hours = int(hourNumber);
minuteNumber = (hourNumber - hours)*60;
mins = int(minuteNumber);
secondNumber = (minuteNumber - mins)*60;
secs = int(secondNumber);
Preloader GotoAndStop Count Down Timer
I just need this preloader to goto a frame every 10 percent loaded, am sure its a simple fix I just cant figure it out, thanks
Code:
if(countdown == 0 ){
preloader.countdown.gotoAndStop("1")
};
if(countdown == 10 ){
preloader.countdown.gotoAndStop("2")
};
if(countdown == 20 ){
preloader.countdown.gotoAndStop("3")
}
//make the preloader not visible
preloader._visible = false;
//make the bar movie clip inside the preloader width at 0
preloader.bar._xscale = 0;
//define new listener object
var mclListener:Object = new Object();
mclListener.onLoadInit = function(container:MovieClip) {
trace('initialized');
};
//maje the preloader visible when the load starts
mclListener.onLoadStart = function(container:MovieClip) {
preloader._visible = true;
trace('started');
};
//make the bar and percent test show the preloading
mclListener.onLoadProgress = function(mc, w, t) {
trace('progress: '+w+", "+t);
var w = container.getBytesLoaded();
var t = container.getBytesTotal();
countdown = Math.round(w/t*100);
preloader.percent = Math.round(w/t*100)+"%";
preloader.bar._xscale = Math.round(w/t*100);
};
/*make the preloader not visible when its finished loading.
You could add other actions here to make the movie do what ever, like _root.gotoAndStop (whatever) */
mclListener.onLoadComplete = function(container:MovieClip) {
trace("loaded");
};
/* You can use this preloading code to load jpg's also.
So you could add a dynamic text field that says "No Image availible" if there is no image to load*/
mclListener.onLoadError = function(container:MovieClip, errorCode:String) {
trace('not loaded');
};
//fire the MovieClipLoader and attach the listener to it
var container1:MovieClipLoader = new MovieClipLoader();
container1.addListener(mclListener);
container1.loadClip("main10.swf", container);
Count Down Timer With Stop And Go Function (flash 5 Only)
I have used the folowing code to make the timer count down.
__________________________________________________ __
onClipEvent (load) {
startTime = getTimer();
countFrom = 10;
}
onClipEvent (enterFrame) {
currTime = getTimer();
elapsedTime = currTime-startTime;
timeRemain = Math.round(countFrom-elapsedTime/1000);
_root.time = timeRemain;
if (timeRemain<0) {
_root.gotoAndStop(2);
}
}
__________________________________________________ __
c
can some one please help me with the stop and go functions?
Count Down Timer, Doesnt Work In January
Hello all,
I have this flash count down timer, it worked fine last year but now it is acting up....for some reason when you put in any date to count down to in january...it adds as many days as it would take to finish off the month, pluss the amount of time i am requesting.
Any help would be great,
I can post the coding on her if anyone would like to try and help me find the bug...
Thanks
Peter
FYI I am using Flash mx 2004 pro
FYI
Count UP Timer And Html Coding Question
I have two separate questions that I would love to receive help with. I recently started dabling in flash and decided to make some interactive options on my teams website. I ran into some issues, both should be basic and quick answers for any experienced flash users.
1-I need a count UP timer. I will be using this to show how long a member has been on my team. I want to be able to input a date into the action script and it counts up from there. I have found endless count down timers but I could not modify them to count up. It needs to have the year, month, day, minute, second, and millisecond displays on it as well.
2-Is there any way to get flash to recognize html coding on/in a symbol or text field? I want the exported swf to be able to pull html code and embed the received code into certain section of the swf.
Here is the code I want to embed:
(here is the link so you can see what it is)
Xbox Live Gamercard
Here is the code that needs to be embedded:
<iframe src="http://gamercard.xbox.com/R1R%20Phantom.card" scrolling="no" frameBorder="0" height="140" width="204">R1R%20Phantom.</iframe>
I am basically updating our website with new features and interactivity. This code displays your gamer name for your Xbox Live account. Here is the old player profiles:
old profiles
You can see I created a table in the upper left to house the embedded code. Is there any way to do that in flash or will i be forced to create a swf and have to embed the code via dreamweaver/imageready/etc?
I would really appreciate any help that you can guys can give me.
Phantom
How Do You Make A Count-down Timer For Recording Live Streaming Video
I have flash media server... and I want to setup a countdown timer for recording broadcasts
Here's a Scenario:
User wants to do a Live broadcast.. But.. they don't want to just press record and have it starting Recording their video right that second. They need a Delay or countdown timer that will countdown and then start recording which would allow them to prepare for their Live Broadcasts.
Whats the best way for a script for a user to decide how much time delay they need before Recording Starts?
Ideally it would look like this:
There is a separate window that allows the user to set up a Self-Countdown Timer which will give them time to get ready for their live broadcasts and start a countdown timer and then begin recording once the timer hits 0.
User sets length of Time Delay: 30 seconds, 1 minute, 2 minutes, or even up to 5 minutes.
User presses Start Broadcast or Record Button to start streaming Live Video.
Then.. the Countdown Timer starts... and it displays in Big Digits on the users screen..... "3...2...1... then it says "Broadcasting Live Now!"
Is This Possible? If so, can someone tell me How would I do this?
Hope someone can help
Timer In MX 2004 (AS2)
Hi all,
Am having troubles (major) getting my head around AS2. I made a countdown timer in MX, that started counting down from a time specified in a variable once a start button had been hit. The start button moves play back head to next frame.
Am currently trying to use this timer in a new movie, and need some of the CSS features in MX 2004, so can't go back to MX. I can't get the timer to work.
The script for the timer (MX) is:
// initiating timer
elapsedTimeSinceStart = Math.round(getTimer()/1000);
//
function restartTimer() {
maxTime = 20;
currentTime = maxTime-elapsedTimeSinceStart;
newTime = maxTime-currentTime;
myNewTime = newTime+currentTime;
timing = true;
this.output = myNewTime;
}
function newTimer() {
newCurrentTime = Math.round(getTimer()/1000);
newStartTime = newCurrentTime-elapsedTimeSinceStart;
}
timer_mc.onEnterFrame = function() {
timing = false;
reStartTimer();
newTimer();
this.output = myNewTime-newStartTime;
if (this.output == -1) {
_root.gotoAndStop("repeat");
}
};
The setup is a mc timer_mc with a dynamic text box with var = output.
Can anyone offer some help on how to consrtuct this in AS2. It will stop me pulling my hair out.
Thanks in advance,
Megs
"count" & Timer Question
Can someone help ?..
I read on the flash 5 books "creative web animation"
and at the advanced actionscript corner..,at the while, and for statement, I come across variable name like
"count = 1"
can i check with u guyz if the count is a keyword or juz a variable..?
Coz the book does not says if define the variable properly. and coz confusion in me.
And one more thing is that I wanted to create game that make uses of time to calculate the high score like, if u managed to finish the game fastest then u can win the game..
How can i actually use time to control?..?
iss't the variable "count" got to do with this?..
PLS help!! dessperate need help!....i need to do for my final project!...
thankzz
roland
Countdown Timer To 30th November 2004
Hi there,
I did a bit of a search on the site but probably missed it...
I need a bit of code that will display the number of days remaining until the 30th November 2004.
I have a dynamic text field ready with a variable name of daysLeft.
Any help much appreciated.
Using FlashMX publishing out to Flash 5.
Word Count (or Character Count) For An Input Field
How would I create a word/character count field to count down characters used when typed into an input filed.
i.e. input field has a maxChar=255. I want the user to see the chars count down from 255, so they'll know how many they have left.
I figure it would be along the lines of wordCountField=maxChar-currentNumOfChars...would that be right?
Thanks.
Word Count (or Character Count) For An Input Field
How would I create a word/character count field to count down characters used when typed into an input filed.
i.e. input field has a maxChar=255. I want the user to see the chars count down from 255, so they'll know how many they have left.
I figure it would be along the lines of wordCountField=maxChar-currentNumOfChars...would that be right?
Thanks.
Switch Simple Count Up To Count Down
Hello...first post for me after finding a lot of great info here.
I've found a simple count up script over on Actionscript.org
var count:Number = 0;
var maxNum:Number = 1250;
var num:Number = 1;
this.createTextField("txt", this.getNextHighestDepth(), 0, 0, 100, 50);
onEnterFrame = function () {
count += num;
if (count >= maxNum) {
num = 0;
txt.text = "125.0";
} else {
var v = count / (maxNum / 125);
txt.text = v;
var str = String(v);
var io = str.indexOf('.');
if (io == -1)
{
txt.text = v + '.0';
}
}
}
This works great for my use, but now I am trying to figure out how to make it count down. I've tried changing everything to opposites like count=1250 and maxNum=0 (I think this would be the minNum instead), count+=num to count-=num, and count>=maxNum to count<=maxNum. But I'm stuck...any ideas? I'll search through the forum to see if I can find any info, but if anyone has a answer, that would be great. Thank you very much!
Difference Between Timer.stop() And Timer.reset()?
Hello,
What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption?
Thanks,
Nilang
Difference Between Timer.stop() And Timer.reset()?
Hello,
What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption? Code is attached below.
Thanks,
Nilang
Attach Code
// Declarations
var url:URLRequest;// Url
var snd:Sound;// Sound Object
var sndChan:SoundChannel;// Sound Channel Object
var sndPosition:Number;// File offset
var tmr:Timer;// Timer object
var isPlaying:Boolean;// Flag to indicate whether file is
// playing or not
var isPlayDelayed:Boolean;// Flag to indicate whether starting
// of file has been delayed or not
var hours:Number = 0;// Hours
var minutes:Number = 0;// Minutes
var seconds:Number = 0;// Seconds
var milli:Number = 0;// Milliseconds
var pauseTime:Number = 0;// Time when paused
var pauseLength:Number = 0;// Length of pause
var buttonPressTime:Number = 0;//
var timing:Boolean = false;// Flag
// Initialize variables.
isPlaying = false;
isPlayDelayed = true;
sndPosition = 0;
// Get url
url = new URLRequest("sound1.mp3");
// Create new Sound object
snd = new Sound();
// Create new SoundChannel Object
sndChan = new SoundChannel();
// Create a new Timer Object with timeout of 5 sec.
// and repeat it only once.
tmr = new Timer(5000, 1);
// Load the audio file
snd.load(url);
// Enable Event Listeners
tmr.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
stop_btn.addEventListener(MouseEvent.CLICK, onStop);
pause_btn.addEventListener(MouseEvent.CLICK, onPause);
play_btn.addEventListener(MouseEvent.CLICK, onPlay);
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
// Start time
pauseElapsedTime(false);
// Start Timer
tmr.start();
// Function that handles timer events
function onTimerComplete(e:TimerEvent):void
{
// Play audio file when timer complete event is received
sndChan = snd.play(sndPosition);
// Set the isPlaying to true to indicate file is playing
isPlaying = true;
// Set the isPlayDelayed to false
isPlayDelayed = false;
trace("onTimerComplete: " + e);
trace("target: " + e.target);
trace("current target: " + e.currentTarget);
}
// Function that captures frame events
function onEnterFrameHandler(e:Event):void
{
// Local variables
var totalTime:Number = (getTimer()/1000)-pauseLength;
var goTime:Number = totalTime-buttonPressTime;
// If flag is true, then calculate the time that has elapsed
if( timing )
{
// Calculate time
hours = Math.floor(goTime/3600);
minutes = Math.floor((goTime/3600-hours)*60);
seconds = Math.floor(((goTime/3600-hours)*60-minutes)*60);
milli = Math.floor((goTime-(seconds+(minutes*60)+(hours*3600)))*100);
// Display elapsed time
timeText.text = format(hours) + ":" + format(minutes) + ":" + format(seconds) + "." + format(milli);
}
}
// Function that captures mouse click events when user clicks stop button
function onStop(me:MouseEvent):void
{
// Reset time
restartElapsedTime();
if (isPlaying)
{
// If audio file is playing then stop the audio file, set file offset to zero,
// and set isPlaying flag to false
sndChan.stop();
sndPosition = 0;
isPlaying = false;
isPlayDelayed = true;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then reset the timer and
// set isPlaying to false
tmr.reset();
isPlaying = false;
}
}
// Function that captures mouse click events when user clicks pause button
function onPause(me:MouseEvent):void
{
// Pause time
pauseElapsedTime(true);
if (isPlaying)
{
// If audio file is playing then stop the audio file,
// set file offset to current offset, and set isPlaying flag to false
sndChan.stop();
sndPosition = sndChan.position;
isPlaying = false;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then stop the timer and
// set isPlaying to false
tmr.stop();
isPlaying = false;
}
}
// Function that captures mouse click events when user clicks play button
function onPlay(me:MouseEvent):void
{
// Start time
pauseElapsedTime(false);
if (!isPlaying)
{
if (!isPlayDelayed)
{
// If the audio file is not playing and playback is not delayed, then
// play the audio file from the last offset and set isPlaying to true
sndChan = snd.play(sndPosition);
isPlaying = true;
}
else
{
// If the audio file is not playing and playback is delayed, then
// start the timer and set isPlaying to false
tmr.start();
isPlaying = false;
}
}
}
// Function that sets the time to 00:00:00.00 (default)
function restartElapsedTime():void
{
timeText.text = "00:00:00.00";
buttonPressTime = (getTimer()/1000)-pauseLength;
pauseElapsedTime(true);
}
// Function that pauses time
function pauseElapsedTime(b:Boolean):void
{
if( b )
{
pauseTime = getTimer()/1000;
}
else
{
pauseLength = ((getTimer()/1000)-pauseTime)+pauseLength;
}
timing = !b;
}
// Function adds 0 to the front of the number when it is < 10 and
// returns a String
function format(n:Number):String
{
if( n < 10 )
{
return ("0"+n);
}
return n.toString();
}
Timer - Not Timer Class, But Time Taken To Do Certain Events
So i'm making a little game and want to know how to start a timer and display the number of milliseconds between the start and finish of two different events. I do not want to run a function after 5000 milliseconds or whatever, just record the length of time taken to say click two buttons.
Basically a stopwatch.
I saw the getTimer(); function but i'm not sure of how to use it or if that is what i need.
Once again, thanks for your time.
Running Timer And Timer With Offset
Hello all,
I'm trying to set up two timers in that dare feed the time in minutes and seconds from the server.
Basically, I've got a master running timer in seconds and minutes but also want to have a second cloned timer that is feed some seconds via flashVars to add to the the master time.
Both of these timers once set by the sever time feed in, and with one being offset, are called every second by a setInterval function call so they count up.
Setting up the master running timer isn't a problem but with my coding skills is a little messy..
Code:
_global.masterRunningTimeInMinutes = 59;
_global.masterRunningTimeInSeconds = 55;
if (_global.masterRunningTimeInSeconds>0 && _global.masterRunningTimeInSeconds<59) {
_global.masterRunningTimeInSeconds++;
} else {
_global.masterRunningTimeInSeconds = 0;
_global.masterRunningTimeInSeconds++;
if (_global.masterRunningTimeInMinutes>=0 && _global.masterRunningTimeInMinutes<=58) {
_global.masterRunningTimeInMinutes++;
} else if (_global.masterRunningTimeInMinutes>=59 && _global.masterRunningTimeInSeconds>=0) {
_global.masterRunningTimeInMinutes = 0;
}
}
if (_global.masterRunningTimeInSeconds<10) {
_global.masterRunningTimeInSeconds = "0"+_global.masterRunningTimeInSeconds;
}
_root.runningTime.text = "v"+_global.masterRunningTimeInMinutes+":"+_global.masterRunningTimeInSeconds;
Ideally I wanted to to get the master running time to display MM:SS so if anyone can help with that that would be great!
I suppose the real problem I'm having is is setting up the pattern for determining the cloned time with the offset.
This is becoming a real headache but if anyone can help I would really appreciate it! Basically I just wanted to have the running time with the cloned time always a certain amount of seconds ahead.
Many thanks, amp3
Flash MX 2004/2004 Pro - Bring Back The Old Undo - Petition To Macromedia
Many of you will know that the removal of the movie clip specific undo is causing us enless hassles and this isn't one of those features that we just get used to, this is a serious workflow hindrance.
We have been discussing in this in more detail here if you want to read more first http://webforums.macromedia.com/flas...hreadid=709486
I don't want this thread to become another discussion about it as it has already been done, but I do want to get a petition together of emails or names which we can send to macromedia or maybe they will take notice here, so If you feel the same way that I do then reply here.
[I]Free Brainbench Flash MX 2004 / Dreamweaver MX 2004 Exams
Got it from one of the blogs and you should try it... I've got one myself... Not sure what I am going to do with it though...
Free Brainbench Flash MX 2004 / Dreamweaver MX 2004 exams ONLY for TODAY
http://www.gunthersoft.com/brainbenc...tional_special
"... ONLY TODAY, that's February 28th, Brainbench certification tests for MacroMedia Dreamweaver MX 2004 and Flash MX 2004 are sponsored, meaning, these tests which are normally $49.95 each are free for the TODAY ONLY!"
Can MX 2004 Pro Files Be Opened And Modified In MX 2004?
Hi,
I've done alot of work with Flash MX 2004 Pro in a class I took. I'm looking into buying the Flash program for my own personal use. I checked out the school store and found that I could buy Flash MX 2004 there at a discount price.
My question is, will Flash MX 2004 allow me to open the .fla files I finished in my class, even though I used Flash MX 2004 Pro to make them? If not, I'll have a lot more saving to do...
Thanks for any feedback.
Count Down
This is a really simple question ( hence in newbie forum) about how to count down from lets say 30 seconds. Not using the stupid put 30 frames and each frame be a second. I a need variable. Thanks for putting up with such a dumb question.
How Can I Count From 60 To 0
Hello all
I need a timer shown on the flash movie that shows the number 60 decrement to 0. How can I do that.
Thank you all in advance.
Count Down Help
Count down clock
I’m wondering if anyone can help me. I know this may be simple, but for some reason I cant get it.
I want to create a countdown clock.
I want it to read the system clock like this
days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
timedate = new Date();
todaydate = timedate.getDate();
day = timedate.getDay();
dayname = days[day];
month = timedate.getMonth();
monthname = months[month];
year = timedate.getFullYear();
hours = timedate.getHours();
minutes = timedate.getMinutes();
seconds = timedate.getSeconds();
fulldate = dayname+", "+monthname+" "+todaydate+", "+year;
if (seconds < 10) {
seconds = "0"+timedate.getSeconds();
}
if (minutes < 10) {
minutes = "0"+timedate.getMinutes();
}
if (hours < 10) {
hours = "0"+timedate.getHours();
}
hour = hours+":"+minutes+":"+seconds;
But, I want the clock to count down from this date
Aug 30th 2002
So that the clock reads “Days, hours, seconds” remaining.
Thanks in advance.
Hit Count
Can someone tell me how u detect if something is hit twice?
I need the script to do nothing until hitTest has happened for the second time on an object, numerically named.
Thanks
Count
When I have a textfield, with text in it. How is it possible to select a certain character out of it. Or do I have to put it first in an array and then select the wanted letter?
greetz
kilikMC
Count Up
Hi
I'm a complete newbie when it comes to flash, but I'm trying to use flash to create screensavers and intros for verious website and I need some help...
I wish to create a screensaver for my site, THE BUILD and so far all I have is a background and an updating webcam image which I got help from here .
What I want to do is add a "count up" script like the one I have on THE BUILD saying Day 154 or something. Also, is it possible to grab html from a site and present it in the flash site? (e.g showing the first three news items on THE BUILD and refreshing it every so often).
As I said I am a complete newbie so a step by step tutorial type the thing would be useful but not neccessairy.
Thanks for your help
Jotty
Count
Hi there.
I´m trying to build a number count and I got 2 results, but still can´t figure out how to fix them.
1- I have this code but I couldn´t figure out how to fix its position, color, typo and how to make it stop at 100.
code:-----------------------------------------------------------------------------_root.num = 0;
createTextField("my_txt", 0, 100, 100, 1, 1);
my_txt.autoSize = true;
my_func = function () {
_root.num++;
my_txt.text = _root.num+"% intensive work";
};
my_int = setInterval(my_func, 250);
--------------------------------------------------------------------------------
2- I downloaded a flash file with a countup and countdown and deleted all things referred to the countdown. So I got sowmething that counts from 1 to 999. I want it to start alone, without the button and to stop at 100 hundred. The file:
Count Up?
I have been messing with MCs found here and I just cant get anything to work.
When I preview the movie, "_level0.instance1.counter" shows up in the dynamic textfileld.
I have attached what I am working with. Any help is greatly appreciated.
/z
Count Down
Is there anyway that I can make a countdown script for flash not like the 5,4,3,2,1. But one that displays time and date. I found this but I dont know haow to incorporate the script into flash
<script language="JavaScript1.2">
/*
Dynamic countdown Script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and TOS,
visit http://www.dynamicdrive.com
*/
function setcountdown(theyear,themonth,theday){
yr=theyear;mo=themonth;da=theday
}
//////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
//STEP 1: Configure the countdown-to date, in the format year, month, day:
setcountdown(2004,12,25)
//STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
var occasion="Christmas!"
var message_on_occasion="Merry Christmas!"
//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
var countdownwidth='480px'
var countdownheight='20px'
var countdownbgcolor='lightblue'
var opentags='<font face="Verdana"><small>'
var closetags='</small></font>'
//////////DO NOT EDIT PASS THIS LINE//////////////////
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","A ug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all? document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')
window.onload=start_countdown
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000) )/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000 ))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da ){
if (document.layers){
document.countdownnsmain.document.countdownnssub.d ocument.write(opentags+message_on_occasion+closeta gs)
document.countdownnsmain.document.countdownnssub.d ocument.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+ closetags
return
}
//if passed day of occasion
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.d ocument.write(opentags+"Occasion already passed! "+closetags)
document.countdownnsmain.document.countdownnssub.d ocument.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+"Occasion already passed! "+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.d ocument.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.d ocument.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags
}
setTimeout("countdown()",1000)
}
</script>
<ilayer id="countdownnsmain" width=&{countdownwidth}; height=&{countdownheight}; bgColor=&{countdownbgcolor}; visibility=hide><layer id="countdownnssub" width=&{countdownwidth}; height=&{countdownheight}; left=0 top=0></layer></ilayer>
Count Up
it is going to be for a project were people donate money to help kids in need, so i need to make something that looks like it is real time adding up the amount so far donated. there is no way for me to give the real amount because it would be changing so fast so we just want something that say starts out at a nuber and goes up by 5 cents an hour.
how crazy hard is this to do?
thanks all
Count Down
Hi,
i need an example for function that will count down the time that remains till certain date .... like:
remains: 2days 4hours 4minutes 24seconds till day X
thanks
|