amfphp - using the api key in Flash 8

public
group: Services
timosea - Thu, 2008-06-12 13:40

ello, i'm new to this group and to the service / amfphp modules. after following the flash 8 section in the services hand handbook [http://drupal.org/node/140893 ] i've got my flash site to connected to drupal, so a well happy. but i'm struggling to find out how to implement the api and session keys in as2; the as3 stuff seem really cool, but my site need run in as2. Could anyone point me in the right direction of any as2 classes or help with some basic syntax, where do i add the api and session keys?
var node:Service = new Service("http://sitedomain/services/amfphp", new Log(), "node", null, null);
cheers, Tim.

Using the code from the Flash 8 example...

bmcmurray@drupal.org's picture
bmcmurray@drupal.org - Thu, 2008-06-12 14:30

When you set up the service method call, you need to pass it all required parameters. If you add in an apiKey then that becomes a required parameter for every method call and should be passed as the first parameter to any call like this:

var apiKey:String = "<<my apikey from drupal>>";
var pc:PendingCall = node.load(apiKey, 1);

B.McMurray


thanks for the info

timosea - Thu, 2008-06-12 14:52

it all make sense now, the example in the handbook, skips this step; i guess it obvious to most people.

Thanks again for the pointer, Cheers, Tim