Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to get php server response into html5 OpenFL haxe app

Tags:

I have a json string being printed using Lib.print(string); in haxe/php and am hosting that on my localhost

I've checked http://localhost/index.php, and it does indeed print the json object as text.

My HTML5 app has the following code in it

var h = new HttpJs('http://localhost/index.php');

function traceFunc (d:String){trace(d); }
h.onData = traceFunc; 
h.onError = traceFunc;

This has yet to come back with an onData response (or onError for that matter). I know I have to be missing something simple.

like image 664
John Doughty Avatar asked Sep 18 '18 20:09

John Doughty


1 Answers

It seems like you forgot to actually invoke the request?

h.request(false);

(using false for the post argument to make sure it's a GET instead of a POST request)

like image 100
Gama11 Avatar answered Oct 11 '22 14:10

Gama11