Skip navigation
Currently Being Moderated

Working with Date-driven content

Aug 1, 2012 7:11 AM

Tags: #flash #swf #xml #action_script_3 #date

At the company I work for, we're getting into doing a lot of banners which are date-driven utilizing an XML doc as the asset.  Of course, for testing purposes, the only method I know in which to test to make sure that the data is populating correctly is to change the date on my machine.  There are obviously a world of annoyances that come up with changing the date and time on your machine (Outlook, Mail, Time Machine, etc). 

 

The question I have is if there is another way of being able to do this?  Is there a widget out there?  I've considered traces but I don't know what to trace and would it even matter if I'm looking for response to a future date v. the current date?

 

Any ideas?

 
Replies
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 1, 2012 7:37 AM   in reply to amitchzone

    if date/time accuracy is important you should be retrieving the date/time from a server, not locally.  if it's not important you can use a function to return the date/time using the flash date class for deployment and set the date/time manually when testing.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 7:41 AM   in reply to amitchzone

    So your content reads the systems local time and generates a banner based upon that from the XML content?

     

    Easiest thing to do, if you have access to the code, is modify the line of code that retrieves the date and set it explicitly:

     

    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b902 04-7f10.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7f0c

     

    You can create the date object with any date you like.

     

    e.g.

    var myDate:Date = new Date("Wed Aug 1 2012 10:42:00 AM");

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 8, 2012 7:17 AM   in reply to amitchzone

    You did mention you just wanted to test it. That's why I mentioned if you have access to creating the SWF you can local test it and set the date explicitly rather than reading the local machines (or servers) time. It's easy to change the date sent into the Date object to generate any date/time you want and then you don't need to mess with your systems time at all.

     

    Windows in a VM should let you change system time very easily. Just right-click on the clock and select "Adjust date/time". Go to the "Internet Time" tab and verify that time is not being set automatically from "time.windows.com". Hit the "Change Settings" button and uncheck the "Syncronize with an Internet time server". Then you won't be bothered by your clock being auto-fixed for you and you should be able to set the date/time to anything you like for testing.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 8, 2012 7:22 AM   in reply to amitchzone

    again, you can set the date/time manually while testing.

     

    copy and paste the code you're using to return the date time if you don't understand how to set the date/time manually.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points