Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-20
1
Medium Priority
?
247 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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…
Suggested Courses

730 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