Time API for AS3.0?

Yay, its time for Event.ENTER_FRAME!

Time API for AS3.0?

Postby dannymurong on Mon Mar 24, 2008 9:30 am

Hi all,

Do you guys come across any Time API (similar to Google or Yahoo! Weather API) which allows me to get the current time of countries (with daylight saving)?

Cheers
dannymurong
 
Posts: 7
Joined: Thu Nov 29, 2007 4:30 pm

Re: Time API for AS3.0?

Postby shunjie on Tue Mar 25, 2008 3:04 am

Check out this world time engine.

http://blog.programmableweb.com/2008/02 ... orld-time/

I am not sure if they support flash as I cannot find any crossdomain.xml file on the server. Maybe can bug them to put up one for you if you purchase their api :D
User avatar
shunjie
 
Posts: 229
Joined: Wed Oct 17, 2007 6:05 am

Re: Time API for AS3.0?

Postby intosite on Tue May 13, 2008 5:50 pm

shunjie wrote:Check out this world time engine.

http://blog.programmableweb.com/2008/02 ... orld-time/

I am not sure if they support flash as I cannot find any crossdomain.xml file on the server. Maybe can bug them to put up one for you if you purchase their api :D


erm.. actually i learnt this trick/hack from my friend.
needs php.. you then load this php file with in the same domain of your flash app.
think it's only good for small xmls or text files.. not for images cause your server will generate a temp file and save it.. if not used carefully, the server will keep generating a file for every request and eventually use up all your hosting space.

here's wat i used it with.
http://labs.djsonny.info/calendar/

Code: Select all
<?php
$site_url = 'http://www.website.com/fileYouWantToLoad.xml?variables=ifAny';
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $site_url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

ob_start();
curl_exec($ch);
curl_close($ch);
$file_contents = ob_get_contents();
ob_end_clean();

echo $file_contents;
?>
intosite
 
Posts: 5
Joined: Tue May 13, 2008 3:19 am

Re: Time API for AS3.0?

Postby ArulPrasad on Fri Jul 11, 2008 7:25 am

This post's been pretty old, but i thought it makes sense to add this link in here:

There is a google app engine project that gives u precisely what you are looking for: http://json-time.appspot.com/

Read abt this one, from Aral Balkan's blog post here: http://aralbalkan.com/1410

Of course if you are using this in Actionscript, u'll have to parse the JSON response. There is a JSON parser in as3corelib (http://code.google.com/p/as3corelib/), just in case you dint know.

Cheers,
Arul Prasad.
ArulPrasad
 
Posts: 10
Joined: Wed Oct 17, 2007 5:30 am


Return to Actionscript 3.0

Who is online

Users browsing this forum: No registered users and 1 guest

cron