I'm new to ActionScript and Flash environments (just started) and I'm trying to get data from a .php file. So I found this AjaxRequest class on the internet.
And I'm testing it with my Main actionscript class, which is in the same package with AjaxRequest.as
My function (constructor of HelloWorld.as) is:
// Create a TextField object and set its content to my php (AJAX) output
var t:TextField = new TextField( );
//Line 38 is this :
t.htmlText=new AjaxRequest("http://localhost/my_ajax_agent.php?action=flash");
addChild(t);
When I run the flash file that has main class as HelloWorld.as, I get the following error:
C:\path\to\HelloWorld.as, Line 38 1067: Implicit coercion of a value of type pakaj:AjaxRequest to an unrelated type String.
Edit: My question is this :
What should I do in order to get an AJAX call's result as a String?
Thanks for any help !
Note: My *ajax_agent.php* file only does this.
if(@$_GET['action']=="flash"){echo "Hello World";}