“time” is the variable of the dynamic text box that the time is supposed to be displayed in. ** It’s contained within the same MC as the code.That’s important** There was a tut where i saw the code for something like this on FLASHKIT, but it didn’t go into depth…i know I’m missin something (minor or major I’m not sure) can someone let me know wut it is…
its not really that important, i just was trying to learn variables and outputs…thanks for any help…the only thing that is displayed in the output box are the two colons in that last statement…
if you make your text box a movie, and then put the code on that movie, it should work.
i cut and pasted your code and it was dandy. you’ll probably want an if statement to add a “0” before the values if they’re less than 10 - turn 9 into 09.
ok, i couldn’t help it. … must … minimise … code …
months = ["jan","feb","mar","apr","may","jun","jul","aug","oct","nov","dec"];
weekdays = ["sun","mon","tue","wed","thu","fri","sat"];
function displayDate(){
var wd,m,d,y,h,mi,s,t;
var now = new Date();
wd = weekdays[now.getDay()];
m = months[now.getMonth()];
d = now.getDate();
y = now.getFullYear();
h = now.getHours();
mi = now.getMinutes();
s = now.getSeconds();
if(h>12){ h-=12; t="pm"; }else{ t="am"; }
if(mi<10) mi = "0"+mi;
if(s<10) s = "0"+s;
return(wd+", "+m+" "+d+", "+y+" - "+h+":"+mi+":"+s+" "+t);
}
trace(displayDate());
supra, thanks, hope your coding is always that smart…i couldn’t be bothered, just cut’n’pasted…you’re still my AS god!
a thought: any way to duplicate a mc in such a way that it makes four of it’s own, placed clockwise all around it, so each time you rollover one of 'em, it makes 4 new ones around itself? any help appreciated…
Creating engaging and entertaining content for designers and developers since 1998.