Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Time and Date

Posted on 2003-11-10
9
Medium Priority
?
599 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

Independent Software Vendors: 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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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…
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.
Suggested Courses

610 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