Solved

Time and Date

Posted on 2003-11-10
9
584 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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
 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

732 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