Hi,

Sorry, I have had a quick look at SabreAMF's source and it is a really simplified AMF gateway, but...

If you are using the callbackserver.php example and have implemented your function:

   function myCallBack($service, $method, $data) {
return "you called " .$method ." and sent me " .var_export($data, TRUE); } $data will contain your server side version of your ArrayCollection - it looks like the php code creates a PHP5 ArrayObject so if you call the remote method with your ArrayCollection, the $data will be your argument - I am not sure whether $data contains all the args but it is worth using the PHP client to test your callback server - look in the examples.

If you don't like messing around making servers and gateway's yourself and want a bit more of a ready to go system with more examples, I would recommend looking at AMFPHP - this has a load more useful help and doc's. The other thing to look at is where Adobe is going with Zend's AMF - this is what the big A seems to have adopted as the AMF solution for PHP. Although I have not played with Zend AMF, AMFPHP seems to be a very robust & nice alternative at the moment, but Patrick Mineault - the creator - was talking about heading back to college, so I would read up and think about which is best learning in the long run. SabreAMF looks okay, but very stripped down compared to some other implementations. Also, when you read this blog: http://www.rooftopsolutions.nl/article/210 it puts things in perspective too.

Sorry for any confusion, but try playing with the callbackserver example and just echo back your data.

Glen

Adir Iakya wrote:
Thanks for help Glen :)

Well, as far as i understand, SabreAMF_ArrayCollection is used to create an array so you'll be able to send it back to the client, I need to exact opposite thing, im sending an array from the client to the server, but i cant use it as is, it seems that i need to use a function that will make it usable in the PHP side.

Cheers,

Adir.


On Dec 1, 2008, at 1:15 AM, Glen Pike wrote:

From the SabreAMF docs -

http://code.google.com/p/sabreamf/wiki/FlexArrayCollection

SabreAMF_ArrayCollections uses PHP's ArrayObject class <http://www.php.net/%7Ehelly/php/ext/spl/classArrayObject.html> to store its data.

Not familiar with PHP's ArrayObject, but guessing there are some useful examples online:

http://uk2.php.net/manual/en/class.arrayobject.php

Glen

Adir Iakya wrote:
Hi All,

I'm having a problem sending arrays or objects from FLEX3 to the server side (my system is working, i got the gateway running ok, and it calls to the right methods).

Sending from the PHP side to client is working cool (I'm using SabreAMF_ArrayCollection for that, works like charm).

Now lets say i want to send this to the server:

var names : Array = new Array( "Ana", "Kate", "John" );

and to foreach it. which SabreAMF function help me to do that?

Same question about objects, i know how to send it to the server, but i don't know how to parse/decode/whatever it on the PHP side so i can use it.

If anyone can paste an example, that would be awesome :-)

Thnx,

AI
------------------------------------------------------------------------

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
osflash mailing list
[email protected] <mailto:[email protected]>
http://osflash.org/mailman/listinfo/osflash_osflash.org

------------------------------------------------------------------------

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to