-
Im confused i need someone to look at this please.
//get date info from system
mydate_ist = new Date();
hrs_ist = mydate_ist.getHours();
mins_ist = mydate_ist.getMinutes();
//put zeros where needed
if (hrs_ist<10) {
hrs_ist = "0" add hrs_ist;
} else {
hrs_ist = hrs_ist;
}
if (mins_ist<10) {
mins_ist = "0" add mins_ist;
} else {
mins_ist = mins_ist;
}
if (mydate_ist.getsec_istonds()<10) {
sec_ist = "0" add mydate_ist.getsec_istonds();
} else {
sec_ist = mydate_ist.getsec_istonds();
}
//send to text field
digitalClock.text = "IST "+hrs_ist+":"+mins_ist+":"+sec_ist;
this is the code that im using to try to get the time for my project but everytime i use it in adobe flash CS5.5 it comes up with these compiler errors
can someone help me please ??
Scene 1, Layer 'CodeLayer', Frame 1, Line 54 1086: Syntax error: expecting semicolon before add.
Scene 1, Layer 'CodeLayer', Frame 1, Line 54 1084: Syntax error: expecting rightbrace before semicolon.
Scene 1, Layer 'CodeLayer', Frame 1, Line 59 1084: Syntax error: expecting rightbrace before add.
Scene 1, Layer 'CodeLayer', Frame 1, Line 64 1084: Syntax error: expecting rightbrace before add.
-
.
Hi,
try:
PHP Code:
//get date info from system mydate_ist = new Date(); hrs_ist = mydate_ist.getHours(); mins_ist = mydate_ist.getMinutes(); sec_ist = mydate_ist.getSeconds(); //put zeros where needed if (hrs_ist < 10) { hrs_ist = "0" + hrs_ist; } else { hrs_ist = hrs_ist; } if (mins_ist < 10) { mins_ist = "0" + mins_ist; } else { mins_ist = mins_ist; } if (sec_ist < 10) { sec_ist = "0" + sec_ist; } else { sec_ist = sec_ist; } //send to text field digitalClock.text = "IST " + hrs_ist + ":" + mins_ist + ":" + sec_ist;
-
does not work =/ im thinking of creating them in action script 3 and then using the get time function in that =S but im not sure any advice ??
-
.
Hi,
the code does work, as for as3 , sorry, cant help you
-
i have tried the code in my product but it doesn't show up the time i have checked all the names the code and put it all in the correct places and i cant seem to get it to work
-
.
Hi,
Post your fla, or a chunk of code
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|