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
Solved

Flash actionscript to get the current time of users local PC, not server

Posted on 2007-03-20
1
221 Views
Last Modified: 2007-03-20
Hi experts,

Is there any flash actionscript to know whether the users local pc time is morning or night. We will use the flash offline

Regards,
Ivan
0
Comment
Question by:huang_ck
1 Comment
 
LVL 37

Accepted Solution

by:
CyanBlue earned 500 total points
ID: 18755084
Flash's Date() object always return you the time for the local PC that's running the SWF...
So, assuming that you are defining 6PM ~ 6AM to be night, you can do something along this line to determine it...

function getNight()
{
      var _now:Date = new Date();
      var _hr:Number = _now.getHours();
      
      if ((_hr < 6) || (_hr > 18))
      {
            trace("It is night here...");
      }
      else
      {
            trace("It is not night here...");
      }
}

getNight();

I don't understand the offline bit though...

CyanBlue
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

791 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