SourceTec Software

It is currently Wed Apr 16, 2014 7:05 pm

All times are UTC + 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Creating a moving clock
PostPosted: Mon Feb 20, 2012 8:56 am 
Offline
Member

Joined: Thu Feb 16, 2012 10:37 am
Posts: 5
I tried the following code in a layers action event but it doesn't update the text when it has an effect.
How can I have the text update while the text is doing an effect?


Update: Dijenga actually answered the question. Sorry for this double post. Anyone else looking for the solution check out his response here

viewtopic.php?f=12&t=326578&p=485355#p485355


//===================

function getnewtime()
{

myTime = new Date();
nSeconds = myTime.getSeconds();
nMinutes = myTime.getMinutes();
nHours = myTime.getHours();
if (nHours>=12)
{ampm = "pm";}
else {ampm = "am";}
if (nHours>=13) {
nHours = nHours-12;
};
if (length(nMinutes) == 1) {
nMinutes = "0"+nMinutes;
};
if (length(nSeconds) == 1) {
nSeconds = "0"+nSeconds;
};
nTime = nHours+":"+nMinutes+":"+nSeconds+" "+ampm;

text1.text=nTime; // Puts the value in a dynamic text box with a label
}


countdown_id = setInterval(getnewtime,1000);


//===================


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group