# Digital clock

**URL:** https://forum.kirupa.com/t/digital-clock/1930
**Category:** flash
**Created:** [April 20, 2002, 12:20pm UTC](https://forum.kirupa.com/t/digital-clock/1930 "2002-04-20T12:20:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 20, 2002, 12:20pm UTC](https://forum.kirupa.com/t/digital-clock/1930/1 "2002-04-20T12:20:36Z")

</div>

how do i make a digital clock?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 20, 2002, 4:45pm UTC](https://forum.kirupa.com/t/digital-clock/1930/2 "2002-04-20T16:45:02Z")

</div>

use the date object to get the time, then concatenate the different time properties you would like to display into one string. place a dynamic text box on the stage and give it the same variable name as the string containing the time information.  
🙂  
jeremy

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 20, 2002, 6:40pm UTC](https://forum.kirupa.com/t/digital-clock/1930/3 "2002-04-20T18:40:54Z")

</div>

could you give me an example

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 20, 2002, 7:25pm UTC](https://forum.kirupa.com/t/digital-clock/1930/4 "2002-04-20T19:25:52Z")

</div>

make a movie with 3 frames, then…  
frame 1 actions:  
\_root.createTextField(“tTime”,1,50,20,100,50);  
\_root.tTimeFormat= new TextFormat();  
\_root.tTimeFormat.color = 0x000000;  
frame 3 actions:  
obDate = new Date();  
sTime=obDate.getHours()+":"+obDate.getMinutes()+":"+obDate.getSeconds();  
\_root.tTime.text = sTime;  
\_root.tTime.setTextFormat(\_root.tTimeFormat);  
gotoAndPlay(\_currentframe-1);

now test the movie. there should be a display there.  
check out the reference for ‘createTextField’ and the methods for the ‘Date’ object for more information.  
hope that helps…  
🙂  
jeremy

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 20, 2002, 7:53pm UTC](https://forum.kirupa.com/t/digital-clock/1930/5 "2002-04-20T19:53:53Z")

</div>

theres a tutorial on this site now. heres the url, if you have any quesitons, you can post, or e-mail me.

[www.kirupa.com/developer/…\_clock.asp](http://www.kirupa.com/developer/actionscript/digital_clock.asp)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 20, 2002, 10:19pm UTC](https://forum.kirupa.com/t/digital-clock/1930/6 "2002-04-20T22:19:56Z")

</div>

but isn’t that for flash 5 ?  
🙂  
jeremy

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 20, 2002, 10:25pm UTC](https://forum.kirupa.com/t/digital-clock/1930/7 "2002-04-20T22:25:49Z")

</div>

yes i wasn’t sure about the code differences but i thought that it would give that individual a place to start…
