Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 …
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now