# Drupal connects to flash (AMFPHP)

**URL:** <https://forum.kirupa.com/t/drupal-connects-to-flash-amfphp/297416>\
**Category:** flash\
**Created:** [October 1, 2009, 6:14pm UTC](https://forum.kirupa.com/t/drupal-connects-to-flash-amfphp/297416 "2009-10-01T18:14:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ventoline](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@ventoline](https://forum.kirupa.com/u/ventoline)\
**Post date:** [October 1, 2009, 6:14pm UTC](https://forum.kirupa.com/t/drupal-connects-to-flash-amfphp/297416/1 "2009-10-01T18:14:51Z")

</div>

I am trying to connect flash to drupal, and the following error is thrown:

```auto
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.Failed

```

I believe the URL is correct so I don’t know what is goind wrong… help anyone?  
Here is the code:

```auto

// Declare our baseURL and gateway
var baseURL:String = "http://localhost/drupal6";
var gateway:String = baseURL + "/services/amfphp";
// Declare our Drupal connection
var drupal:NetConnection = new NetConnection();
drupal.objectEncoding = ObjectEncoding.AMF3;
// Connect to the Drupal gateway
drupal.connect( gateway );
// Set up our responder with the callbacks.
var responder:Responder = new Responder( onConnect, onError);
// Connect to Drupal
drupal.call("system.connect", responder);
// Called when Drupal returns with a successful connection.
function onConnect( result:Object )
{
trace("We are connected!!!");
}
// Called when an error occurs connecting to Drupal.
function onError( error:Object )
{
for each (var item in error) {
trace(item);
}
}

```
