Hi, I'm trying to integrate drupal and flash together.
i set a variable to contain the node id,
ex. var nodeId:Number = root.loaderInfo.parameters.node

and then, when it connect, I call a function.

function onConnect( result:Object ){
//set sessionId variable
sessionId = result.sessid;
trace("We are connected!!!");
trace("Session id: " + sessionId);
trace(nodeId);
loadNode( nodeId);
}

however, in the output i got:

We are connected!!!
Session Id: 80648777e5aebd99c6c0f62be486d1f2
/Applications/MAMP/htdocs/drupal6/sites/default/modules/services/servers/amfphp/amfphp.module
Unknown error type
Could not find the node.
106
AMFPHP_RUNTIME_ERROR

did i give wrong definition to node id???

Comments

mesh’s picture

can you show the loadNode( nodeId) function in detail. i guess something is wrong there. here's what works for me..

function onConnect(result:Object):void {
  sessionId=result.sessid;
  loadNode('6');
}

function loadNode(arg:String):void {
  var nodeResponse:Responder = new Responder(onNodeLoad, onError);
  drupal.call("node.get", nodeResponse, sessionId, arg);
}
function onNodeLoad(node:Object):void {
  trace(node.nid);
}
rolf vreijdenberger’s picture

Hi David,

Does the node exist? did you alter the permissions to give the user access to node data?

Also, I recommend http://www.dpdk.nl/opensource/drupalproxy-as-a-bridge-between-flash-as3-...
a comprehensive opensource implementation

this is a tested implementation and features *everything* you would ever need, but is still simple to use. with documentation.