Creating Clock Confusion
Friday, January 26, 2007 by HeirOfSlytherin | Discussion: Beginners
Any help would be the greatest. Once you point me in the right direction, i'll get it.
Reply #3 Saturday, January 27, 2007 4:55 AM
Reply #4 Saturday, January 27, 2007 9:02 AM
Create an object for each graphic (4 objects: second hand, minute hand, hour hand, clock face)
Start with the clock face. Right click on one of the objects and open Properties > Summary and name your object (clock_face or whatever you want).
Also in the summary tab set the Left and Top positions (lets say 200 left and 300 top).

Go to the States tab and under Appearance browse for your clock face graphic.
Hit apply.

Repeat those steps for the second hand, minute hand, and hour hand. Make sure you set the left and top positions to the same left and top positions of the clock face (200 left 300 top).
Now, right click on the DXBuilder icon (which should be in your system tray) and choose List Objects.
Draw a selection around all three clock hands.
Right click on this selection and choose set parent. Set the parent to the clock face.
Now select all 4 of your objects, right click, and group as "clock" (or whatever you prefer)
After that, go to the clock face Properties > General. Create a new script and paste the script below.
Sub Object_onscriptenter
object.SetTimer 1, 1000
End Sub
Sub object_ontimer1
t = FormatDateTime(time(),3)'---Get your system time
h= hour(t)'---Get current hour
desktopx.object("hour_hand").Rotation= h * 30 '---Multiply current hour to get correct rotation
m= minute(t)'---Get current minute
desktopx.object("minute_hand").Rotation= m * 6 '---Multiply current minute to get correct rotation
s= second(t)'---Get current second
desktopx.object("second_hand").Rotation= s * 6 '---Multiply current second to get correct rotation
End Sub
Hope this helps.

Reply #5 Saturday, January 27, 2007 2:30 PM
Reply #6 Saturday, January 27, 2007 4:04 PM
Reply #7 Saturday, January 27, 2007 5:30 PM
I reached a snag in following the instructions. When i highlighted the hands in object navigator and set the parent to my "face clock", it worked ok. But when i highlight all four object and grouped them, it kicked out my hour hand and i got an error message when scripting that the hour hand could'not be found. I notist when it asked what method of grouping, there are three choices. I tryed all three and it still kicks out my hour hand. Any ideas?Reply #8 Saturday, January 27, 2007 8:32 PM
Reply #9 Saturday, January 27, 2007 9:14 PM
I guess the key is trial and error.
Reply #10 Sunday, January 28, 2007 1:16 AM
| I guess the key is trial and error. |
That's how I spend 90% of my time with DX. Soon enough things will get easier. Glad you worked everything out.
Happy DXing!Reply #11 Sunday, January 28, 2007 7:26 AM
- I'm the type of person that has a lot of trouble following just written directions. I'm lucky enough to have a good friend ( buzzh58 ) that will take the time to show me step by step teaching me how to do DX and other programs etc. If I am showed one step at a time , my brain usually retains the process.
So pictures with directions are the next best thing. DX is my favourite program to play with but its not easy for someone with no scripting back ground. Thank God for people that share their scripts....They make it possible for people like me that enjoy DX but will never understand scripts.
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Friday, January 26, 2007 4:38 PM
Clocks are a pain in the ass but I hope this gets you started ok