Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show the day and time

Status
Not open for further replies.

Juniare

Technical User
Oct 14, 2002
14
0
0
US
I want my movie to show the day and time in a text field. And if the time is morning, I want my background picture to be of a morning sky, and afternoon (sunset), a sunset sky, then night, a night sky. So how can I do this?
 
Another Question:

How do I stream Mp3s from my webpage to the movie, and have a load bar also...I've been trying to do that for the longest.

And, what should I use to make 3D games. (the graphics).
Some sort of 3D software like Maya, or something. Or do I have to use Lingo? Cause if so, I'll never get it done.
 
Director can obtain the date and time info from the system using
Code:
date
and
Code:
time
(!) Attaching the following behavior to a text sprite will display the date and time:
Code:
--
property spriteNum

on enterFrame me
  sprite(spriteNum).member.text = the long date && the long time
end enterFrame
--
Instead of
Code:
the long date
, you can also use
Code:
the date, the abbreviated (abbrev, abbr) date, the short date
. They all have different display format. (Same for
Code:
the time
)

Thus, you can determine the time of the day by using
Code:
the time
. But you have to be careful since the time format varies from country to country, platform to platform, machine to machine…

Something like this should work wherever you are:
Code:
--
hourNow = (the time).char[1..(offset(":", the time) - 1)]
if not((the time) contains "PM") then
   if hourNow > 4 and hourNow < 11 then
	sprite(backGroundSpriteNum).member = member(&quot;morningBackground&quot;)
   end if
end if
--

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top