import mx.remoting.*; import mx.rpc.*; import mx.remoting.debug.NetDebug; /* //gateway string var gatewayUrl:String = "http://www.mandalatv.net/remoting/gateway.php"; NetDebug.initialize(); var _service:Service = new Service(gatewayUrl, null, 'ShowComments', null, null); pc.responder = new RelayResponder(this, "handleResult", "handleError"); function handleResult(re:ResultEvent) { trace('The result is: '+re.result); } function handleError(fe:FaultEvent) { trace('There has been an error'); } */ //#include "NetDebug.as" // Must be included for Remoting to work //#include "NetServices.as" // Set our gateway and service var myURL = "http://www.mandalatv.net/remoting/gateway.php"; var myServicePath = "ShowComments"; // Set our object to receive server messages var myResult = new Object(); //this is what php returns - here array of objects myResult.onResult = function(val) { var count = val.length;2 for (var i = 0; i"+val[i][1]+"\""+"\n" + "-"+val[i][0]+""+" on "+ val[i][2] + "\n"; } }; //this is called if there is an error in the php script myResult.onStatus = function(info) { trace("error is "+info.description); }; System.onStatus = myResult.onStatus; // create connection, set service and call remote method var myServer = NetServices.createGatewayConnection(myURL); var myService = myServer.getService(myServicePath, myResult); myService.displayComments(); clear_btn.onRelease = function ():Void { addComment_txt.htmlText = ""; name_txt.htmlText = ""; } submit_btn.onRelease = function ():Void { var c:String = addComment_txt.text; var n:String = name_txt.text; myService.setComment(n, c); }