0

Im trying to connect AMFPHP with an actionscript file, everything is working perfectly except the part of the connection between them.

This is how I try to connect the .as file with the service:

_netConnection = new NetConnection(); 
_netConnection.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
_netConnection.connect("http://localhost/Core/Gateway.php");

The thing is, I cant make it work. I also tried to replace http for rtmpt (http tunneling) but it also doesnt work, I added the port after localhost, I tried several, no luck.

Depending on the port I add after localhost, the onNetStatus is not even called, or it says that it cant connect.

Any help?

Thanks!

Artemix
  • 8,497
  • 14
  • 48
  • 75
  • 1) have you set your services-config.xml and compiler arguments? 2) have you browsed the gateway url, is all ok with php (any errors)? I found this on google maybe check it ... http://groups.drupal.org/node/2768 – Adrian Pirvulescu Nov 13 '12 at 07:41
  • Do You running Your SWF from local host too ? Or debug/test flashplayer window ? – turbosqel Nov 13 '12 at 10:58
  • @Adrian 1) no, I didnt set the services config or compiler argument 2) yes, the php is working. Turbosqel from another folder – Artemix Nov 13 '12 at 13:57

2 Answers2

1

your url looks funny. If it's amfphp V2.x, you should be pointing at Amfphp/ (or Amfphp/index.php)

  • Yeah, I changed that and now works, I checked the troubleshooting section in your forum, it was very helpful, thanks. – Artemix Nov 23 '12 at 02:27
0

If you could tell us the version of you amfphp it would be more convenient to answer. Assuming you are using Amphp v 2.x here goes a piece of concept.

in flex, write something like this:

var _amf:RemoteObject = new RemoteObject();
    _amf.destination = "dummyDestination";
    _amf.endpoint = "/Amfphp/";
    _amf.source = "yourphp";
    _amf.phpFunctionYouWantToCallWithParameterIfNeeded;

that's all you basically need to create a connection between flex and amfphp 2.x