Solved

Time and Date

Posted on 2003-11-10
9
567 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

770 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