Solved

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

Posted on 2007-03-20
1
229 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

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

Suggested Solutions

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…
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 how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

685 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