Adobe Dreamweaver Forums



Last 10 THreads :         Browser (Last Post : michel_v - Replies : 1 - Views : 2 )           »          certificate (Last Post : jkhgdkhgslkj - Replies : 2 - Views : 3 )           »          Flex with JSP (Last Post : JB2622 - Replies : 5 - Views : 6 )           »          Is there a way to extract a subset of an arraycollection (Last Post : Amy Blankenship - Replies : 4 - Views : 5 )           »          Getting Tree Item Editor to show on an Event other thanitemClick (Last Post : ericbelair - Replies : 2 - Views : 7 )           »          mxmlc - "Unable to resolve resource bundle "rpc" forlocale "en_US" (Last Post : ugrowemweschickm - Replies : 2 - Views : 6 )           »          export hidden layers error (Last Post : gelon - Replies : 0 - Views : 1 )           »          Dynamic dropdown (Last Post : idesdema - Replies : 0 - Views : 1 )           »          Re: Dynamic dropdown (Last Post : Ian Skinner - Replies : 0 - Views : 1 )           »          perform action "on save"? (Last Post : AXEmonster - Replies : 1 - Views : 6 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flash
 
Tags:

Reply
  #1 (permalink)  
Old 07-24-2008, 03:08 PM
welling1977
 
Posts: n/a
Diggs:
Default Count up clock based in another time zone

I've made a count-up clock. However, I'm trying to get it to work off another
timezone and am having a few problems.
Below is the code I've been working with. I need the clock to display 12 hours
ahead and am unsure as to how to do this. Also, when it reaches a certain date
in the future, I need it to then play another section off the timeline and stop.

Please, any insight is very appreciated!!


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-27-2008, 04:53 AM
Ray_Lea
 
Posts: n/a
Diggs:
Default Re: Count up clock based in another time zone

I can not find a way to add 12 to the clock but you just take 12 off the date
and time, this is my counter and it's my birthday 14 sept so I set it 12 hours
early

var ABC:Number = 1

onEnterFrame = function () {

var todayate = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();

var myHours = today.getHours();
var myMinutes = today.getMinutes();
var mySeconds = today.getSeconds();



if(myHours<10){
myHours="0"+myHours
}
if(myMinutes<10){
myMinutes="0"+myMinutes
}
if(mySeconds<10){
mySeconds="0"+mySeconds
}

var targetDateate = new Date(2008,9,13,12);
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 day = Math.floor(hrs/24);

var counter:String = "0:00:00:00";

sec = String(sec % 60);
if (sec.length < 2){;
sec = "0" + sec;
} //end

min = String(min % 60);
if (min.length < 2){;
min = "0" + min;
} //end

hrs = String(hrs % 24);
if (hrs.length < 2){;
hrs = "0" + hrs;
} //end

day = String(day);

if (timeLeft <= 0){;
counter = "0:00:00:00";
ABC = 0
}//end

else{
counter = day + ":" + hrs + ":" + min + ":" + sec;
} //end

theTime_txt.text=myHours+":"+myMinutes+":"+mySecon ds;
time_txt.text = counter;

}// end end

//Put this in frame 2//

if(ABC <= 0){;
gotoAndPlay(3);
}
else gotoAndPlay(1);
//put this in frame 3//
//and have what you want to happen//
stop();

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 03:08 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk