Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-14-2012, 01:28 AM   #1
mavi
Senior Member
 
Join Date: Jan 2008
Posts: 108
Default getDate with php and as3

Hi there.

I'm going crazy trying to get the server time.
My php-file is called getDate.php and the content is

Code:
<?php
echo date("Y/m/d/H/i/s");
?>
my flash file has a text field called resultBox and the following action script

Code:
var req:URLRequest = new URLRequest("getDate.php");
var loader:URLLoader = new URLLoader(req);
// loader.load();

loader.addEventListener(Event.COMPLETE,handleGetDate);
function handleGetDate(event:Event):void
{
   resultBox.text=event.target.data;
}
Does anybody know what Im doing wrong?
i get no output when i try it on the server, but php is enabled.
I also attached the file.
Any help wold be GR8
Thanx
mavi
Attached Files
File Type: zip Archive.zip (9.0 KB, 26 views)
__________________
FM
mavi is offline   Reply With Quote
Old 04-14-2012, 02:54 AM   #2
ASWC
Super Moderator
 
ASWC's Avatar
 
Join Date: Dec 2007
Location: Greenville, SC
Posts: 6,528
Default

Use time() instead and print it then use it with a Date instance in AS3.
__________________
aswebcreations
Super Duper!
ASWC is offline   Reply With Quote
Old 04-14-2012, 03:02 AM   #3
mavi
Senior Member
 
Join Date: Jan 2008
Posts: 108
Default

Well, the problem is... whatever I use in my php file, it gets deformed or only arrives in pieces.

For example:...

print "hello" only arrives as "llo"
__________________
FM
mavi is offline   Reply With Quote
Old 04-14-2012, 03:09 AM   #4
ASWC
Super Moderator
 
ASWC's Avatar
 
Join Date: Dec 2007
Location: Greenville, SC
Posts: 6,528
Default

if you mean that's how it looks in your textfield then check that you have the font embedded before going further.
__________________
aswebcreations
Super Duper!
ASWC is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:31 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.