Solved

Time and Date

Posted on 2003-11-10
9
547 Views
Last Modified: 2010-04-03
Hello,

I would like to have the current time and date in a corner of my movie.  Is this possible?

thanks,

j
0
Comment
Question by:zenlion420
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 5

Author Comment

by:zenlion420
ID: 9719001
using flash MX, btw

j
0
 
LVL 27

Assisted Solution

by:negatyve
negatyve earned 75 total points
ID: 9719401
0
 
LVL 5

Author Comment

by:zenlion420
ID: 9719498
Thanks,

what exactly is in the .as file?

j
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 75 total points
ID: 9720513
i had a look at your negatyve's example ,it's hectic:

again, here's a simple option

create a dynamic textfield where you want the date and time shown. (in this case called time)
create an empty movieclip on the screen.
attach this code to the movieclip:
onClipEvent (enterFrame) {
      timer = new Date();
      _root["time"].text = timer;
}

check the help files on different ways to format the date.

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 27

Expert Comment

by:negatyve
ID: 9720707
>what exactly is in the .as file?

it's a file containing some actionscript code, imported, when the movie is exported, with this line:

#include "ShowTime.as"

when the swf is created, it's no longer needed.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 9720713
negatyve, the programmer in you is definately apparent!
I've saved those files to figure out how you've managed to complicate a simple Date object.

but it looks good :-)

0
 
LVL 27

Expert Comment

by:negatyve
ID: 9720876
>I've saved those files to figure out how you've managed to complicate a simple Date object.

eheheh, I know your code is enough to make it work, but in italy this is not readable "Tue Nov 11 10:03:18 GMT+0100 2003"
we have to change months and days names, and reformat the output, and that's why that code is so funny.. :)
0
 
LVL 5

Author Comment

by:zenlion420
ID: 9724014
Thanks, both of you.

j
0
 

Expert Comment

by:pheva
ID: 9769484

Why not the simplest method:

1) Create an input text field, make it movie symbol.
2) Add the following actions to get the current date:

onClipEvent(enterFrame){
    curDate = new Date();
    aDayName = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    iName = curDate.getDay();

    sDate = curDate.getDate();
    sMonth = curDate.getMonth();
    sYear = curDate.getFullYear();

    txtDate = aDayName[iName] + " " + sDate + "/" + sMonth + "/" + sYear;
    updateAfterEvent();
}

Hope all the above info was useful..
Cya,
Pheva
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now