Solved

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

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adobe Flash Player - PPAPI plugin 6 798
bandwidth 5 87
Can not play videos on sciencechannel.com in Chrome 13 158
IE11 stops playing video on a certain website 10 110
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

751 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