?
Solved

Time and Date

Posted on 2003-11-10
9
Medium Priority
?
595 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 300 total points
ID: 9719401
0
 
LVL 5

Author Comment

by:zenlion420
ID: 9719498
Thanks,

what exactly is in the .as file?

j
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 39

Accepted Solution

by:
blue-genie earned 300 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

Technology Partners: 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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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 record live broadcast.

762 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