Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 8:52 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: UTC Script
PostPosted: December 29th, 2007, 12:59 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
Hi All,

I made alittle UTC clock pub but for some reason i cant get it to display the time ( great clock ;) I creadted a txt object and placed the script below in it . It also says in the window that the below script has errors in it , but i used the examples ( cut and paste) from the examples area....

I will attach the IMP as well , and explanation on what to do OR where i went wrong is appreciated.......

Al

var myDate = new Date()
var currHour = myDate.getUTCHours()

var myDate = new Date()
var currMins = myDate.getUTCMinutes()

if (currMins < 10)
{
currMins = "0" + currMins)
}


var myDate = new Date()
var currSecs = myDate.getUTCSeconds()

if (currSecs < 10)
{
currSecs = "0" + currSecs)
}


You do not have the required permissions to view the files attached to this post.

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 29th, 2007, 1:25 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
No time to view the pub now, but a couple thoughts.

Make sure variables declared within scripts don't take names of variables out on Page or Pub. (I think).

Also, I think I recall that Text object will not display variables created within a script. Will only display variables 'set into' the Text box... e.g. using "Insert Variable" (right click pop up in editor)

Launch the script console when previewing, and use the "Watch variable" feature. Cool.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: December 29th, 2007, 8:50 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
When you are trying to build something like this, get the basic structure working before you start adding transparency, transitions, video and other things that make the pub difficult to work on.

Give text boxes, buttons etc names that mean something to you.
I add a t in front of text box names, a b in front of button names.
For example;
give an exit button a name like bExit.
give a text display box a name like tDisplay.
give a promo video a name like vPromo.
This will make it easier for you (and anyone else) to see what your pub is trying to do.

I've made a few script corrections;
You have a couple of extra ")"'s in the script -- they must always be in matching pairs.

currMins = "0" + currMins)
should be
currMins = "0" + currMins

currSecs = "0" + currSecs)
should be
currSecs = "0" + currSecs

I've added the word "new" in front of Date();
You only need to use "new Date()" once.
I renamed the clock display text box so it has a different name from the variable myDate. Everything in a pub should have a different name, including variables.

I've made the time display in the textbox by stringing the various times into one variable; I presume that is where it is supposed to be. :)

The video was stopping the time from refreshing properly.
The attached pub has the clock working.

Paul


Top
 Profile  
 
 Post subject: Thanks Paul
PostPosted: December 30th, 2007, 1:48 am 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
I am new to scripting and seeing what you have done really explains it well . The part that makes me laugh is that DW's scripts were bugged ( smile ).....


I have noticed on many occasions i have had problems with scripts only because they didn't work with other transitions ( + more) and that is a bummer . As many of your guys show me the ways and explain why you do what you do , it is helping me to find the right path and understand the mind set to travel it...

Question , you must have things stored in the variable as when the time displays , it is seperated with Semi-Colons . Can you show me the Variable contents.... was it like this

currHour:currmins:currSecs ( as text in the variable )

Just trying to get my head around it.....

Al

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


Top
 Profile Visit website  
 
 Post subject: Re: Thanks Paul
PostPosted: December 30th, 2007, 3:08 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Al Barnes wrote:
Question , you must have things stored in the variable as when the time displays , it is seperated with Semi-Colons . Can you show me the Variable contents.... was it like this

currHour:currmins:currSecs ( as text in the variable )

Just trying to get my head around it.....

Al


That's correct.

Paul


Top
 Profile  
 
 Post subject: Re: Thanks Paul
PostPosted: December 30th, 2007, 7:07 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
[quote="paul"][quote="Al Barnes"]
Question , you must have things stored in the variable as when the time displays , it is seperated with Semi-Colons . Can you show me the Variable contents.... was it like this

currHour:currmins:currSecs ( as text in the variable )

Just trying to get my head around it.....



Thanks Paul ,

THis stuff is actual starting to stick i n my head :)

Al

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 31 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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group